TL;DR
This paper introduces "shared arrangements," a novel technique for streaming dataflow systems that allows multiple concurrent queries to efficiently share indexed, in-memory state. This significantly reduces query installation latency and memory footprint, enabling more interactive and scalable real-time data analytics.
What Problem Does This Paper Address?
Modern streaming dataflow systems, while excellent at incremental processing, typically isolate the execution of independent queries. This leads to substantial redundancy: each query must independently maintain the same indexed state over the same input streams. This is particularly problematic in interactive data analytics scenarios where numerous queries are continuously submitted and updated. Building this state from scratch for each new query is slow and resource-intensive, hindering real-time responsiveness. The paper addresses this by enabling queries to share pre-computed, indexed state, much like traditional relational databases do with indexes.
Methods
The core innovation is "shared arrangements," which are essentially indexed views of maintained state that concurrent queries can reuse. The system achieves this by:
- Hard-partitioning shared state: State is divided across worker threads, and computation (operators) is moved to the data.
- Multiversioning shared state: Within workers, the state is versioned to allow operators to access it at different times and rates without compromising consistency or performance.
- Arrange operator: A new operator is introduced to manage the creation and maintenance of these shared, multiversioned indexed batches of updates.
- Trace handles: These allow operators to access the shared arrangement, providing a consistent view based on their current logical timestamp.
This approach aims to combine the scalability of data-parallel processing with the efficiency of shared indexes, without the fine-grained locking overhead of traditional databases.
Datasets
The paper evaluates their approach using:
- TPC-H: A modified streaming version of the TPC-H benchmark, where relations are progressively loaded and queries are interactively deployed and retired.
- Interactive Graph Queries: A benchmark involving four types of queries (point look-up, 1-hop, 2-hop, 4-hop shortest path) against an evolving graph.
- Datalog Workloads: Standard Datalog benchmarks for program analysis (dataflow and points-to analysis).
- Batch Graph Computation: Standard graph algorithms (reachability, shortest paths, connected components) on large social network graphs (LiveJournal, Orkut, Twitter).
Key Insights and Ideas
- Sharing is Crucial for Interactive Analytics: The paper strongly demonstrates that for interactive, continuously updating data, sharing indexed state is not just an optimization but a necessity for achieving low latency and high throughput.
- Bridging the Gap Between Databases and Stream Processors: Shared arrangements effectively bring the well-established concept of shared indexes from relational databases into the realm of streaming dataflow systems, addressing a long-standing limitation.
- Multiversioning is Key to Scalability: By allowing concurrent access to different versions of the state, the system avoids the coordination bottlenecks that plague traditional shared-index systems, enabling efficient scaling with multiple workers.
- Amortized Merging for Low Latency: The technique of amortized merging for trace maintenance is critical for ensuring low update latencies, even with high data volumes.
- Operator-Awareness Enables Efficiency: Designing operators to be "arrangement-aware" allows them to leverage shared arrangements for significant performance gains, particularly in join operations.
Key Results
- Order-of-magnitude improvements: Shared arrangements achieved order-of-magnitude improvements in query installation latency and significant reductions in memory footprint (2-4x) for interactive TPC-H queries.
- Reduced Update Latency: Update processing latency was reduced by 1.3-3x compared to systems without shared state.
- Improved Throughput: In interactive graph queries, shared arrangements allowed the system to handle 33% more load at peak capacity and significantly increased throughput at given latencies.
- Competitive Performance: DD with shared arrangements demonstrated competitive performance against specialized systems in Datalog and program analysis benchmarks, often outperforming them.
- Memory Savings: Memory footprint was reduced by 2-3x in TPC-H and 4x in graph queries, allowing for more concurrent queries on the same hardware.
Limitations and Future Work
- Sharing is Context-Dependent: The benefits of shared arrangements are most pronounced when actual sharing opportunities exist. Bespoke stream processing computations with highly disjoint windowing might see less benefit.
- Not a General Transaction Processor: Shared arrangements do not support multiple writers and are not designed for general transaction processing.
- Fault Isolation: Sharing can reduce fault isolation between queries compared to redundant, duplicated state.
- Future Work: The authors mention persistence and availability as areas for future exploration, noting that DD's design is well-suited for active-active replication and asynchronous persistence. They also suggest that the arrangement idiom could be applied to other popular dataflow systems.
Summary updated