[Paper Review] Approximate Stream Analytics in Apache Flink and Apache Spark Streaming.
StreamApprox introduces an online stratified reservoir sampling algorithm for approximate stream analytics in Apache Flink and Spark Streaming, enabling real-time, efficient processing with rigorous error bounds. It achieves 1.15×–3× speedup over native systems and 1.1×–2.4× speedup over an improved Spark baseline, maintaining consistent accuracy across sampling fractions from 10% to 80%.
Approximate computing aims for efficient execution of workflows where an approximate output is sufficient instead of the exact output. The idea behind approximate computing is to compute over a representative sample instead of the entire input dataset. Thus, approximate computing - based on the chosen sample size - can make a systematic trade-off between the output accuracy and computation efficiency. Unfortunately, the state-of-the-art systems for approximate computing primarily target batch analytics, where the input data remains unchanged during the course of sampling. Thus, they are not well-suited for stream analytics. This motivated the design of StreamApprox - a stream analytics system for approximate computing. To realize this idea, we designed an online stratified reservoir sampling algorithm to produce approximate output with rigorous error bounds. Importantly, our proposed algorithm is generic and can be applied to two prominent types of stream processing systems: (1) batched stream processing such as Apache Spark Streaming, and (2) pipelined stream processing such as Apache Flink. We evaluated StreamApprox using a set of microbenchmarks and real-world case studies. Our results show that Spark- and Flink-based StreamApprox systems achieve a speedup of $1.15 imes$-$3 imes$ compared to the respective native Spark Streaming and Flink executions, with varying sampling fraction of $80\%$ to $10\%$. Furthermore, we have also implemented an improved baseline in addition to the native execution baseline - a Spark-based approximate computing system leveraging the existing sampling modules in Apache Spark. Compared to the improved baseline, our results show that StreamApprox achieves a speedup $1.1 imes$-$2.4 imes$ while maintaining the same accuracy level.
Motivation & Objective
- To address the gap in approximate computing systems for stream analytics, which traditionally focus on batch processing with static datasets.
- To design a generic, online sampling algorithm suitable for both pipelined (Flink) and batched (Spark Streaming) stream processing models.
- To ensure rigorous error bounds in approximate output while enabling significant performance improvements over native and baseline approximate systems.
- To evaluate the system across microbenchmarks and real-world workloads, demonstrating scalability and accuracy trade-offs in dynamic data environments.
Proposed method
- Design of an online stratified reservoir sampling algorithm that maintains representative samples over time in data streams.
- Application of the sampling algorithm to both Apache Flink (pipelined model) and Apache Spark Streaming (batched model) for broad compatibility.
- Integration of the sampling mechanism into stream processing pipelines to compute approximate results with provable error bounds.
- Use of stratification to improve sampling accuracy by preserving distributional characteristics across data partitions.
- Dynamic sampling adjustment based on data arrival rates and system load to maintain efficiency and accuracy.
- Implementation of a hybrid baseline using Spark’s native sampling modules to compare performance and accuracy improvements.
Experimental results
Research questions
- RQ1Can an online stratified reservoir sampling algorithm be effectively adapted to both pipelined and batched stream processing frameworks like Flink and Spark Streaming?
- RQ2How does the proposed system compare in performance and accuracy to native stream processing and existing approximate computing baselines?
- RQ3What is the trade-off between sampling fraction, execution speed, and output accuracy in real-time stream analytics?
- RQ4Can the system maintain rigorous error bounds while achieving significant speedups in dynamic data workloads?
- RQ5How does the system perform across diverse microbenchmarks and real-world use cases?
Key findings
- StreamApprox achieves a 1.15× to 3× speedup over native Apache Flink and Spark Streaming executions when using sampling fractions from 10% to 80%.
- Compared to an improved Spark-based baseline using native sampling modules, StreamApprox delivers 1.1× to 2.4× speedup while maintaining identical accuracy levels.
- The system maintains rigorous error bounds through its online stratified reservoir sampling mechanism, ensuring predictable approximation quality.
- The proposed algorithm is generic and effective across both pipelined (Flink) and batched (Spark Streaming) stream processing models.
- Evaluation on microbenchmarks and real-world case studies confirms consistent performance gains and accuracy stability across diverse data workloads.
- The results demonstrate that approximate stream analytics with bounded error is both feasible and efficient in production-grade stream processing systems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.