NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Out-of-Order Sliding-Window Aggregation with Efficient Bulk Evictions and Insertions

Kanat Tangwongsan, Martin Hirzel, Scott Schneider

TL;DR

This paper introduces a novel algorithm for sliding-window aggregation that efficiently handles both out-of-order data and bulk insertions/evictions, a common scenario in real-world data streams. Their approach significantly improves performance over existing methods, especially for bulk operations, making stream processing more robust and performant.

What Problem Does This Paper Address?

In stream processing, sliding-window aggregation is crucial for summarizing recent data. Existing algorithms are efficient when data arrives one item at a time, even if out-of-order. However, real-world data streams often arrive in "bursts," meaning multiple items are inserted or evicted simultaneously. This can lead to significant latency spikes if not handled efficiently. For example, in time-based windows, a single new data point might trigger the eviction of thousands of old ones. Current algorithms struggle with these bulk operations, either lacking support or having poor theoretical and practical performance. This paper aims to bridge this gap by providing an algorithm that excels at both out-of-order data and bulk operations.

Methods

The core of the paper's contribution lies in a new algorithm built upon the FiBA (Finger B-tree augmented for sliding-window aggregation) data structure. FiBA is already optimized for single out-of-order operations. The authors extend FiBA with novel techniques for:

  • Bulk Eviction: This involves a three-step process:
  • Finger-based Search: Efficiently identifies the boundary nodes in the B-tree that straddle the eviction point.
  • Pass Up: This phase performs the actual evictions and repairs local invariants (like node arity) by moving or merging nodes. It focuses on "up" and "inner" aggregates.
  • Pass Down: This final step repairs "left" and "right" aggregates, ensuring consistency across the tree.
  • Bulk Insertion: This also uses a three-step approach:
  • Finger-based Search: Locates all insertion sites in the tree without modifying it.
  • Interleave & Split Loop (Pass Up): This is the most complex part. It interleaves new entries with existing ones at the leaf level and propagates changes upwards. Nodes that exceed capacity are split, and new "treelets" (representing promoted entries) are generated for the next level. This process is designed to be efficient by processing treelets in timestamp order.
  • Pass Down: Similar to bulk eviction, this step repairs any remaining aggregation invariant violations.

The algorithm achieves its efficiency by sharing work across bulk operations, particularly by processing paths from multiple insertion sites together as low as possible in the tree.

Datasets

The paper uses the NYC Citi Bike dataset for real-world evaluation. They also mention using synthetic data for controlled experiments.

Key Insights and Ideas

  • Bulk operations are a practical necessity: The paper strongly argues that real-world data streams are inherently bursty, making efficient bulk handling not just a theoretical nicety but a practical requirement for low-latency stream processing.
  • Leveraging B-tree structures for streaming: The use of a finger B-tree (FiBA) as the underlying data structure is key. Its ability to efficiently locate elements and maintain balance is adapted for the dynamic nature of streaming data.
  • Location-sensitive aggregates are crucial: The FiBA structure's use of different aggregate types (up, inner, left, right) based on a node's position is vital for avoiding costly global updates and achieving good amortized performance.
  • Work sharing is the key to bulk efficiency: The core algorithmic insight for both bulk insert and evict is to find ways to process multiple items together, sharing computations across common paths in the tree structure.

Key Results

  • Theoretical Improvements:
    • Bulk eviction achieves amortized $O(\log m)$ time, improving upon prior work.
  • Bulk insertion has no prior algorithms for the out-of-order case, and their approach offers competitive theoretical complexity.
  • Practical Performance:
    • Experiments show that their bulk eviction algorithm yields the best latency compared to baselines.
  • For bulk insertion, their algorithm provides the best latency in the out-of-order case, where other algorithms often don't support it at all.
  • The implementation demonstrates good scalability with window size and bulk size, maintaining low latency and high throughput.
  • The deferred free list implementation is critical for achieving the promised algorithmic complexity, preventing memory reclamation from becoming a bottleneck.

Limitations and Future Work

  • Limitations:
    • The paper focuses on single-window aggregation. Extending it to multi-window scenarios or complex windowing schemes might require further work.
  • While the implementation is in C++, they mention not directly using SIMD instructions, which could offer further performance gains.
  • Future Work:
    • The authors suggest exploring new algorithms for multi-range queries, which could benefit from their bulk operation handling.
  • They also mention the potential for partitioning for parallelism, which could be a direction for future research.
  • Further investigation into optimizing for energy efficiency in IoT scenarios is also suggested.

Summary updated

BibTeX
@article{tangwongsan2023out,
  author = {Kanat Tangwongsan and Martin Hirzel and Scott Schneider},
  title = {{Out-of-Order Sliding-Window Aggregation with Efficient Bulk Evictions and Insertions}},
  journal = {Proc. VLDB Endow.},
  year = {2023},
  url = {https://openreview.net/forum?id=HrlM4YHNOS},
}
Figure