Banyan: A Scoped Dataflow Engine for Graph Query Service

Li Su, Xiaoming Qin, Zichao Zhang, Rui Yang, Le Xu, Indranil Gupta, Wenyuan Yu, Kai Zeng, Jingren Zhou

Abstract

Graph Query Services (GQS) are the backbone of modern interactive applications, from recommendation systems to real-time fraud detection. However, traditional dataflow engines struggle with performance isolation and fine-grained control, often falling victim to the "noisy neighbor" problem. We present Banyan, a novel engine based on a scoped dataflow model. By isolating sub-traversals into independent, dynamic scope instances, Banyan enables surgical precision in query management and scheduling. Our evaluation demonstrates that Banyan achieves up to three orders of magnitude performance improvement over state-of-the-art engines while ensuring robust performance isolation in multi-tenant environments.

Introduction: The Challenge of Fine-Grained Control

Existing graph engines typically employ "topo-static" dataflows—fixed pipelines where messages from different parts of a query or different users are interleaved. This lack of isolation creates a significant "noisy neighbor" problem: if one part of a query begins exploring a massive "supernode" (such as a celebrity with millions of followers), it can saturate the entire pipeline. This congestion makes it nearly impossible to cancel that specific sub-traversal without terminating the entire query. Furthermore, static models prevent the application of optimal scheduling strategies—such as Breadth-First Search (BFS) versus Depth-First Search (DFS)—to different segments of the same query, leading to wasted computation and high latency.

Comparison of traditional dataflow (c) and scoped dataflow (d) for a complex graph query (a).

The Scoped Dataflow Model

Banyan addresses these limitations by introducing the "scope" construct, which marks specific subgraphs in the dataflow representing logical subqueries.

Dynamic Scope Instances and Physical Isolation

At runtime, the engine can dynamically replicate a scope into multiple scope instances. Each instance is physically independent, processing a specific subset of the traversal. This isolation ensures that a heavy sub-traversal in one instance does not block progress in others. If a subquery finds its required result early (e.g., in a top-k search), Banyan can terminate that specific scope instance immediately, reclaiming resources without affecting concurrent operations.

Detailed view of scope instances providing physical isolation for concurrent sub-traversals.

Hierarchical Scheduling

Banyan organizes operators into a tree structure where parent "scope operators" schedule their children. This architecture allows for customized scheduling policies. For example, a query can use BFS to find neighbors within a certain hop count while simultaneously using DFS to eagerly check predicates within a specific branch. This flexibility allows Banyan to prioritize work that is most likely to yield results, significantly reducing total latency.

Implementation: The Banyan Engine

Built in C++, the Banyan engine is designed for high-concurrency, low-latency environments. It utilizes single-threaded executors pinned to physical cores and employs cooperative scheduling. By managing scheduling at the application level rather than relying on the OS, Banyan avoids the heavy overhead of context switching and prevents "thread explosion" in multi-tenant scenarios. Additionally, Banyan partitions graph data into "tablets" that can be migrated between executors at runtime to handle data skew and ensure dynamic load balancing.

Evaluation and Key Results

The researchers evaluated Banyan using the LDBC Social Network Benchmark (SNB) and a new Complex Query (CQ) benchmark designed to reflect real-world interactive services.

  • Massive Speedups: On LDBC benchmarks, Banyan outperformed Neo4j and JanusGraph by 5x to 1,000x. It was also up to 14x faster than TigerGraph on large-scale queries.
  • Superior Cancellation: On the CQ benchmark, Banyan was up to 726x faster than GAIA. This is primarily because Banyan can cancel sub-traversals instantly at the scope level rather than filtering through mixed message streams.
  • Robust Isolation: In tests with mixed workloads, Banyan’s latency for small queries remained stable (fluctuating only ~10%), whereas competitors saw latencies spike by over 200% under heavy load.
  • Linear Scalability: Banyan demonstrated near-linear performance scaling as more cores were added and showed efficient scale-out capabilities in distributed clusters.

Conclusion and Future Work

Banyan demonstrates that the scoped dataflow paradigm is a game-changer for Graph Query Services, providing the isolation and control necessary for modern, high-demand applications. While the current implementation incurs a 13-25% overhead when early cancellation is not utilized, the benefits in complex, multi-tenant scenarios are overwhelming. Future work will focus on developing a high-level declarative language and an automated query compiler to allow users to easily leverage Banyan's complex processing pipelines without needing deep knowledge of the underlying engine mechanics.

Summary updated

BibTeX
@article{su2022banyan,
  author = {Li Su and Xiaoming Qin and Zichao Zhang and Rui Yang and Le Xu and Indranil Gupta and Wenyuan Yu and Kai Zeng and Jingren Zhou},
  title = {{Banyan: A Scoped Dataflow Engine for Graph Query Service}},
  journal = {Proc. VLDB Endow.},
  year = {2022},
  url = {https://openreview.net/forum?id=u7MrB57EvFq},
}
Figure