Abstract
Current systems for data-parallel, incremental processing and view maintenance over high-rate streams isolate the execution of independent queries. This creates unwanted redundancy and overhead in the presence of concurrent incrementally maintained queries: each query must independently maintain the same indexed state over the same input streams, and new queries must build this state from scratch before they can begin to emit their first results. This paper introduces shared arrangements: indexed views of maintained state that allow concurrent queries to reuse the same in-memory state without compromising data-parallel performance and scaling. We implement shared arrangements in a modern stream processor and show order-of-magnitude improvements in query response time and resource consumption for interactive queries against high-throughput streams, while also significantly improving performance in other domains including business analytics, graph processing, and program analysis.
Introduction
Modern stream processing systems excel at incremental view maintenance, ensuring query results remain current as new data arrives. However, a significant limitation persists: queries are typically executed in isolation. When multiple queries require the same indexed state—for instance, joining different data streams against a common users table—each query independently constructs and maintains its own private index. This isolation leads to redundant computation, excessive memory consumption, and a "cold start" problem where new queries must process the entire history of an input stream before producing results.
Shared Arrangements Architecture
To address these inefficiencies, we propose Shared Arrangements, a mechanism that brings the "shared index" concept from relational databases to distributed, data-parallel streaming. The architecture centers on a single-writer, multiple-reader model.
The system consists of three primary components:
- The Trace: A multiversioned, LSM-style data structure. It stores immutable batches of updates, allowing different queries to access state at various logical timestamps without interference.
- The Arrange Operator: Acting as the single writer, this operator receives update streams, batches them, and appends them to the Trace while performing background compaction.
- Read Handles: These allow multiple downstream operators (e.g., Joins or Groups) to navigate the Trace independently.
A key enabler of this architecture is the use of logical timestamps from Timely Dataflow, which allows multiple readers to maintain a consistent view of the data even as the writer appends updates. This "post-hoc sharing" capability means new queries can attach to an existing index and immediately access its full history. Furthermore, because join operators receive pre-arranged batches, they perform work proportional to the size of the update rather than the entire state, facilitating near-instantaneous deployment.
Evaluation and Key Results
We evaluated Shared Arrangements within the Differential Dataflow (DD) framework across diverse workloads, including streaming TPC-H, interactive graph queries, and complex program analysis.
The results demonstrate significant improvements over traditional isolated execution:
- Reduced Installation Latency: By attaching to existing shared arrangements, new queries can begin processing immediately. Installation latency dropped from seconds or minutes to milliseconds.
- Memory Efficiency: In TPC-H benchmarks, sharing state reduced the overall memory footprint by 2–4×.
- Enhanced Throughput: Graph processing tasks saw a 33% increase in load capacity and a 2–3× reduction in tail latency.
- Broad Applicability: In program analysis, the system outperformed specialized tools like Graspan by orders of magnitude, enabling complex analysis on standard hardware.
Conclusion
Shared Arrangements provide a practical path toward efficient multi-query execution in streaming environments. By leveraging logical time and a single-writer architecture, the system eliminates redundant state maintenance and enables near-instantaneous query deployment. While currently optimized for analytical workloads with a single writer per shard, this approach significantly lowers the resource barrier for high-throughput, interactive data processing.
Summary updated