Table of Contents
Fetching ...

Cuckoo Heavy Keeper and the balancing act of maintaining heavy hitters in stream processing

Vinh Quang Ngo, Marina Papatriantafilou

TL;DR

Heavy hitters in data streams require high throughput, bounded memory, and accurate frequency estimates, even under concurrent inserts and queries. Cuckoo Heavy Keeper (CHK) rethinks the data flow by inserting a lightweight lobby as a filtering stage before a cuckoo-hashed heavy-part, enabling selective collision resolution and system-aware optimization. The authors also introduce a parallel framework with mCHK-I and mCHK-Q that wraps CHK (and other sequential heavy-hitter algorithms) to support concurrent inserts and queries without requiring mergeable data structures, achieving near-linear scale and low latency. Across real and synthetic workloads, CHK delivers 1.7–5.7x throughput gains and up to four orders of magnitude accuracy improvements, with robust performance under memory constraints and varying data skew, demonstrating practical impact for large-scale stream processing systems.

Abstract

Finding heavy hitters in databases and data streams is a fundamental problem with applications ranging from network monitoring to database query optimization, machine learning, and more. Approximation algorithms offer practical solutions, but they present trade-offs involving throughput, memory usage, and accuracy. Moreover, modern applications further complicate these trade-offs by demanding capabilities beyond sequential processing that require both parallel scaling and support for concurrent queries and updates. Analysis of these trade-offs led us to the key idea behind our proposed streaming algorithm, Cuckoo Heavy Keeper (CHK). The approach introduces an inverted process for distinguishing frequent from infrequent items, which unlocks new algorithmic synergies that were previously inaccessible with conventional approaches. By further analyzing the competing metrics with a focus on parallelism, we propose an algorithmic framework that balances scalability aspects and provides options to optimize query and insertion efficiency based on their relative frequencies. The framework is capable of parallelizing any heavy-hitter detection algorithm. Besides the algorithms' analysis, we present an extensive evaluation on both real-world and synthetic data across diverse distributions and query selectivity, representing the broad spectrum of application needs. Compared to state-of-the-art methods, CHK improves throughput by 1.7-5.7$\times$ and accuracy by up to four orders of magnitude even under low-skew data and tight memory constraints. These properties allow its parallel instances to achieve near-linear scale-up and low latency for heavy-hitter queries, even under a high query rate. We expect the versatility of CHK and its parallel instances to impact a broad spectrum of tools and applications in large-scale data analytics and stream processing systems

Cuckoo Heavy Keeper and the balancing act of maintaining heavy hitters in stream processing

TL;DR

Heavy hitters in data streams require high throughput, bounded memory, and accurate frequency estimates, even under concurrent inserts and queries. Cuckoo Heavy Keeper (CHK) rethinks the data flow by inserting a lightweight lobby as a filtering stage before a cuckoo-hashed heavy-part, enabling selective collision resolution and system-aware optimization. The authors also introduce a parallel framework with mCHK-I and mCHK-Q that wraps CHK (and other sequential heavy-hitter algorithms) to support concurrent inserts and queries without requiring mergeable data structures, achieving near-linear scale and low latency. Across real and synthetic workloads, CHK delivers 1.7–5.7x throughput gains and up to four orders of magnitude accuracy improvements, with robust performance under memory constraints and varying data skew, demonstrating practical impact for large-scale stream processing systems.

Abstract

Finding heavy hitters in databases and data streams is a fundamental problem with applications ranging from network monitoring to database query optimization, machine learning, and more. Approximation algorithms offer practical solutions, but they present trade-offs involving throughput, memory usage, and accuracy. Moreover, modern applications further complicate these trade-offs by demanding capabilities beyond sequential processing that require both parallel scaling and support for concurrent queries and updates. Analysis of these trade-offs led us to the key idea behind our proposed streaming algorithm, Cuckoo Heavy Keeper (CHK). The approach introduces an inverted process for distinguishing frequent from infrequent items, which unlocks new algorithmic synergies that were previously inaccessible with conventional approaches. By further analyzing the competing metrics with a focus on parallelism, we propose an algorithmic framework that balances scalability aspects and provides options to optimize query and insertion efficiency based on their relative frequencies. The framework is capable of parallelizing any heavy-hitter detection algorithm. Besides the algorithms' analysis, we present an extensive evaluation on both real-world and synthetic data across diverse distributions and query selectivity, representing the broad spectrum of application needs. Compared to state-of-the-art methods, CHK improves throughput by 1.7-5.7 and accuracy by up to four orders of magnitude even under low-skew data and tight memory constraints. These properties allow its parallel instances to achieve near-linear scale-up and low latency for heavy-hitter queries, even under a high query rate. We expect the versatility of CHK and its parallel instances to impact a broad spectrum of tools and applications in large-scale data analytics and stream processing systems

Paper Structure

This paper contains 36 sections, 4 theorems, 8 equations, 8 figures, 5 tables, 5 algorithms.

Key Result

theorem 1

For a counter value $C$ with decay base $b$, where each decay operation sets the value $C=C-1$ with probability $b^{-C}$, the expected counter value $E[dc_{C,w}]$ after $w$ decay operations is:

Figures (8)

  • Figure 1: Cuckoo Heavy Keeper consists of two tables of buckets. Each bucket has one lobby entry to filter infrequent items and multiple heavy entries to maintain heavy-hitter candidates.
  • Figure 2: lobby item $z$ replaces the minimum-counter item $n$ in the heavy part, which then triggers relocation via cuckoo hashing. The process may continue recursively until finding an empty slot, or reaching MAX_KICKS, or encountering a below-threshold item.
  • Figure 3: Sensitivity to decay base and heavy entries per bucket
  • Figure 4: Plots show performance of sequential algorithms on CAIDA_L dataset for throughput, $log_{10}$(ARE), precision, and recall across varying memory, and $\phi$. See §\ref{['sec:eval_seq_methodology']} for calculation details.
  • Figure 5: Plots show performance of sequential algorithms on CAIDA_H dataset for throughput, $log_{10}$(ARE), precision, and recall across varying memory, and $\phi$. See §\ref{['sec:eval_seq_methodology']} for calculation details.
  • ...and 3 more figures

Theorems & Definitions (8)

  • theorem 1
  • proof
  • lemma 1: Heavy Hitter Promotion Guarantee
  • proof
  • theorem 2: Approximation Bounds
  • proof
  • theorem 3: Parallel Approximation Bound
  • proof