TL;DR
This paper introduces SHARON, a novel approach for efficiently aggregating massive workloads of event sequence queries in real-time streaming systems. By intelligently sharing intermediate aggregation results and optimizing the selection of sharing opportunities, SHARON achieves significant speedups and reduced memory usage compared to existing methods.
What Problem Does This Paper Address?
Modern streaming applications, from ride-sharing services to e-commerce platforms, rely on Complex Event Processing (CEP) to detect patterns and aggregate insights from high-velocity event streams. Evaluating numerous event sequence aggregation queries simultaneously presents a significant challenge. Existing state-of-the-art approaches often suffer from long delays due to inefficient sharing of intermediate results or by constructing entire event sequences before aggregation, which becomes computationally prohibitive for high-rate streams. This paper addresses the problem of optimizing these multi-query event sequence aggregation workloads to achieve real-time responsiveness.
Methods
SHARON tackles this challenge through a two-pronged approach: an optimized Static Optimizer and an efficient Runtime Executor.
The Static Optimizer is responsible for finding an optimal "sharing plan" at compile time. Its key innovations include:
- Sharing Benefit Model: A model to accurately assess the benefit of sharing a pattern's aggregation among multiple queries, considering both the gains and the overhead of combining results.
- SHARON Graph: A novel graph representation where nodes represent "sharing candidates" (a pattern and the set of queries that use it) and edges represent "sharing conflicts" between candidates.
- Maximum Weight Independent Set (MWIS) Mapping: The problem of finding an optimal sharing plan is mapped to the MWIS problem on the SHARON graph.
- Pruning Strategies: Efficient techniques are employed to prune non-beneficial and conflict-ridden candidates from the SHARON graph, significantly reducing the search space for the optimal plan. This includes leveraging the guaranteed weight of a greedy MWIS algorithm (GWMIN) and identifying conflict-free candidates.
- Sharing Plan Finder: A search algorithm that efficiently explores the reduced search space to find the optimal sharing plan.
- Sharing Conflict Resolution: An extension to handle cases where sharing opportunities are excluded due to conflicts, by expanding candidates into multiple options.
The Runtime Executor then uses this optimal sharing plan to process incoming events. It performs online event sequence aggregation, meaning it aggregates events as they arrive without pre-constructing sequences. It efficiently combines shared intermediate aggregates to produce the final results for each query.
Datasets
The authors evaluate SHARON using three real-world and synthetic datasets:
- TX: New York City Taxi and Uber Real Data Set: A 330GB dataset containing 1.3 billion taxi and Uber trips from 2014-2015, including pick-up/drop-off locations, timestamps, passenger counts, and payment methods.
- LR: Linear Road Benchmark Data Set: Generated using a traffic simulator, this dataset simulates car position reports for 3 hours, with event rates gradually increasing up to 4k events per second.
- EC: E-Commerce Synthetic Data Set: A synthetic dataset simulating item purchase sequences over 3 hours, with event rates of 3k events per second.
Key Insights and Ideas
- Sharing is not always beneficial: The paper highlights that simply sharing computations isn't always optimal. The overhead of combining shared results can outweigh the benefits, necessitating a sophisticated benefit model.
- Conflicts are key to optimization: Identifying and resolving sharing conflicts is crucial for finding optimal sharing plans. The SHARON graph elegantly encodes these conflicts as edges.
- MWIS as a powerful abstraction: Mapping the complex sharing plan selection problem to the well-studied MWIS problem provides a solid theoretical foundation for optimization.
- Pruning is essential for scalability: The effectiveness of the SHARON optimizer relies heavily on its ability to prune the search space by identifying non-beneficial and conflict-ridden candidates early on.
- Online aggregation is critical for real-time performance: Avoiding the expensive step of constructing event sequences before aggregation is vital for meeting the demands of time-critical streaming applications.
Key Results
SHARON demonstrates significant performance improvements:
- Speedup: Achieves up to an 18-fold speed-up compared to state-of-the-art approaches like A-Seq, SPASS, and Flink.
- Memory Reduction: Requires up to two orders of magnitude less memory than A-Seq for a large number of queries.
- Latency and Throughput: SHARON's latency grows linearly with the number of queries, and it achieves substantial speedups (5-18x) compared to A-Seq as the number of queries increases.
- Optimizer Efficiency: The SHARON optimizer effectively prunes the search space, reducing it by up to 75.59% in their example, and finds optimal plans significantly faster than exhaustive search.
Limitations and Future Work
- Exponential Complexity in Worst Case: While pruning significantly reduces the search space, the theoretical worst-case time complexity of the sharing plan finder remains exponential. The authors suggest constraining optimization time or using a greedy approach (GWMIN) as a fallback.
- Dynamic Workloads: The current approach assumes a static workload. Future work includes investigating event sequence aggregation sharing for dynamic workloads, where queries can be added or removed, and adapting plans on the fly.
- Scalability: The authors propose exploring modern distributed multi-core clusters to further improve the scalability of shared online event sequence aggregation.
- Different Predicates, Grouping, and Windows: While the paper mentions extensions to handle these variations, their full integration and impact are areas for further exploration.
Summary updated