Abstract
HAMLET is a novel framework for Complex Event Processing (CEP) designed to handle high-velocity, bursty event streams. Traditional CEP systems struggle with the exponential complexity of Kleene plus patterns and the overhead of static computation sharing. HAMLET addresses these challenges by combining online trend aggregation with a dynamic sharing optimizer. By adaptively deciding whether to share computations based on real-time stream characteristics, HAMLET achieves up to five orders of magnitude lower latency and significantly higher throughput compared to state-of-the-art methods.
The Challenge of Bursty Event Streams
In high-velocity data environments—such as ridesharing platforms managing millions of trips or stock markets processing thousands of trades per second—Complex Event Processing (CEP) is essential for identifying critical patterns. A particularly powerful yet computationally expensive pattern is the Kleene plus (+), which matches sequences of arbitrary length (e.g., a request followed by one or more travel events).
Existing systems face two primary hurdles:
- Exponential Complexity: Traditional engines attempt to construct every possible event sequence before aggregation. For long sequences, the number of combinations explodes exponentially, rendering real-time performance impossible.
- The Sharing Dilemma: While sharing computations between similar queries can save work, it introduces overhead in the form of "snapshots" (metadata) to track query-specific results. In bursty streams where data distributions shift rapidly, a static sharing plan can become a bottleneck, sometimes performing worse than redundant independent computations.
The HAMLET Framework
HAMLET (Highly Adaptive Multi-query Lightweight Event Trend aggregation) introduces a paradigm shift by treating event matching as a graph traversal problem rather than sequence construction.
Core Components
- Online Trend Aggregation: Instead of building sequences, HAMLET propagates aggregate values (counts, sums, etc.) through a graph structure as events arrive, reducing complexity from exponential to quadratic.
- Graphlets and Snapshots: The system partitions matched events into "graphlets" based on event type and time. To enable sharing across queries with different filters, HAMLET uses snapshots to store intermediate aggregate values.
- Dynamic Sharing Optimizer: This runtime "brain" uses a lightweight benefit model to weigh the cost of snapshot overhead against the savings of shared computation. It can dynamically "split" or "merge" graphlets as stream characteristics change.
Experimental Evaluation
The researchers evaluated HAMLET using four diverse datasets: NYC Taxi and Uber (2.63 billion records), Smart Home sensor data (4 billion measurements), historical Stock Market data, and a synthetic Ridesharing stream designed to stress-test burstiness.
Key Results
- Latency and Throughput: HAMLET outperformed competitors like MCEP, GRETA, and SHARON across all metrics. It achieved up to 5 orders of magnitude lower latency than MCEP and handled 1-2 orders of magnitude more events per second than the next best competitor.
- The Value of Adaptivity: The dynamic optimizer provided a 21–34% speed-up and 27–52% throughput improvement over a static sharing plan. By avoiding unnecessary snapshots, it also reduced memory consumption by approximately 25%.
- Sharing Insights: A critical finding was that sharing is not a universal benefit. If a query has highly restrictive filters, the overhead of maintaining its state in a shared environment often outweighs the computational savings.
Conclusion and Future Work
HAMLET demonstrates that adaptivity is mandatory for processing bursty data. By moving away from sequence construction and embracing dynamic, graph-based sharing, it overcomes the "memory wall" of traditional CEP. Future work will explore extending the framework to support holistic aggregates (like median or mode) and adapting to dynamic query workloads where users add or remove queries in real-time.
Summary updated