Approaching 100% Confidence in Stream Summary through ReliableSketch

Yuhan Wu, Hanbo Wu, Xilai Liu, Yikai Zhao, Tong Yang, Kaicheng Yang, Sha Wang, Lihua Miao, Gaogang XieOpenReview 2024 · DOI

Abstract

To approximate sums of values in key-value data streams, sketches are widely used in databases and networking systems. They offer high-confidence approximations for any given key while ensuring low time and space overhead. While existing sketches are proficient in estimating individual keys, they struggle to maintain this high confidence across all keys collectively, an objective that is critically important in both algorithm theory and its practical applications. We propose ReliableSketch, the first to control the error of all keys to less than $\Lambda$ with a small failure probability $\Delta$, requiring only $O(1 + \Delta\ln\ln(\frac{N}{\Lambda}))$ amortized time and $O(\frac{N}{\Lambda} + \ln(\frac{1}{\Delta}))$ space. Furthermore, its simplicity makes it hardware-friendly, and we implement it on CPU servers, FPGAs, and programmable switches. Our experiments show that under the same small space, ReliableSketch not only keeps all keys' errors below $\Lambda$ but also achieves near-optimal throughput, outperforming competitors with thousands of uncontrolled estimations. We have made our source code publicly available.

Introduction

Data stream processing relies heavily on "sketches"—compact data structures that estimate item frequencies using minimal memory. While traditional sketches like the Count-Min (CM) sketch provide high confidence for individual queries, they fail to maintain this confidence across a large set of keys. For instance, a 99% confidence level for a single key implies that in a scenario with a million keys, thousands will likely be "outliers" with errors exceeding the tolerance threshold. In critical applications like network monitoring, these outliers can lead to significant false positives, misidentifying low-priority traffic as "heavy hitters." ReliableSketch addresses this "collective confidence" gap, ensuring that every key's estimation error remains within a predefined tolerance $\Lambda$.

Methodology

ReliableSketch introduces two core innovations: the Error-Sensible Bucket and Double Exponential Control.

The Error-Sensible Bucket

Standard sketch counters often lack the ability to quantify their own error in real-time. The Error-Sensible Bucket addresses this by maintaining three fields: a Key ID, a YES counter for positive matches, and a NO counter for collisions.

Workflow of the Error-Sensible Bucket showing insertion and query logic.

When an item $e$ with value $v$ is inserted, if $ID = e$, the YES counter is incremented. If $ID \neq e$, the NO counter is incremented. If NO eventually exceeds YES, the bucket performs a replacement, setting the new item as the $ID$ and swapping the counter values. This structure allows the sketch to calculate the Maximum Possible Error (MPE) for any key, providing a built-in sensor for hash collisions.

Double Exponential Control

To manage errors across the entire stream, ReliableSketch organizes buckets into multiple layers. This architecture employs a "Double Exponential" strategy where both the number of buckets (width) and the error thresholds decrease exponentially as items move to deeper layers.

Multi-layer architecture of ReliableSketch featuring the "Lock" mechanism and layer-by-layer threshold decrease.

A key feature is the "Lock" mechanism: when a bucket's MPE reaches a critical threshold, it is locked against new keys that would further increase its error. These items are instead redirected to the next layer. This prevents error accumulation and ensures that the final estimates remain within the global tolerance $\Lambda$.

Experimental Results

The researchers evaluated ReliableSketch against state-of-the-art sketches using real-world datasets, including CAIDA IP traces and web streams.

  • Reliability: In tests with 1MB of memory, ReliableSketch achieved zero outliers, whereas competitors like Count-Min and Elastic Sketch reported over 5,000 outliers. To reach zero outliers on IP Trace data, ReliableSketch required ~0.91MB, which is 6x to 9x more space-efficient than traditional methods.
  • Performance: The algorithm's hardware-friendly design translates to high performance. It achieved 25.4 Mpps on a CPU, 340 Mpps on an FPGA, and line-rate processing at 40Gbps on a Tofino programmable switch.
  • Accuracy: ReliableSketch maintained lower Average Relative Error (ARE) and Average Absolute Error (AAE) across all tested datasets compared to existing solutions.

Conclusion

ReliableSketch represents a significant advancement in stream summary algorithms by shifting the focus from individual query confidence to collective reliability. By integrating real-time error sensing and multi-layer control, it eliminates outliers while maintaining the high throughput and low memory footprint required for modern high-speed networking and database systems.

Summary updated

BibTeX
@misc{wu2024approaching,
  author = {Yuhan Wu and Hanbo Wu and Xilai Liu and Yikai Zhao and Tong Yang and Kaicheng Yang and Sha Wang and Lihua Miao and Gaogang Xie},
  title = {{Approaching 100\% Confidence in Stream Summary through ReliableSketch}},
  year = {2024},
  eprint = {2406.00376},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.00376},
  howpublished = {OpenReview},
}
Figure