Introduction
In the era of Big Data, distributed stream processing systems like Apache Storm and Spark Streaming are essential for real-time analytics in sectors ranging from finance to urban mobility. To manage massive data volumes, these systems partition workloads across multiple processing instances. However, real-world data is frequently "skewed"—a small subset of keys, such as viral hashtags or high-frequency stock symbols, often accounts for the vast majority of traffic. This skewness leads to significant load imbalances that degrade system performance.
The Partitioning Dilemma
Standard systems typically employ one of two partitioning strategies, each with inherent flaws:
- Shuffle Grouping: Distributes data evenly using a round-robin approach. While this ensures load balance, it creates a "memory nightmare" because every processing instance must maintain state for every possible key, limiting scalability.
- Key Grouping: Routes all data with the same key to a specific instance. This is memory-efficient but vulnerable to "stragglers"—instances overwhelmed by "hot" keys while others remain underutilized.
PStream: Differentiated Scheduling
PStream addresses this challenge through Differentiated Scheduling. Rather than applying a single strategy, it treats keys differently based on their popularity:
- Hot Keys are handled via Shuffle Grouping to distribute heavy computational loads across all available instances.
- Rare Keys are managed via Key Grouping to keep memory consumption low.
To implement this, PStream utilizes a lightweight hot key predictor based on probabilistic "coin-flipping" experiments, identifying heavy hitters with minimal overhead. A two-level architecture confirms these keys using Counting Bloom Filters (CBF), while an adaptive threshold mechanism adjusts definitions of "hotness" based on real-time stream dynamics.
Evaluation and Key Results
The researchers evaluated PStream using massive real-world traces from Twitter, NASDAQ, and DiDi Taxi. PStream significantly outperformed state-of-the-art designs like Partial Key Grouping (PKG) and Distribution-aware Key Grouping (DKG), achieving a 2.3x to 3.6x improvement in throughput and a 64% reduction in latency.
As illustrated in Figure 2(b), while Key Grouping is efficient under low skew, its throughput collapses as the Zipf coefficient increases. PStream's hybrid approach mitigates this collapse by offloading these high-frequency keys to shuffle grouping, maintaining high performance even under extreme skew.
Conclusion and Future Work
PStream demonstrates that the trade-off between load balance and memory scalability is a false choice. By splitting traffic into "hot" and "rare" lanes, the system achieves superior efficiency and responsiveness. Future work may explore applying this differentiated approach to more complex stateful operators or geo-distributed clusters where network latencies vary significantly.
Summary updated