POS: A High-Level System to Simplify Real-Time Stream Application Development on Storm

Bin Cui, Jie Jiang, Quanlong Huang, Ying Xu, Yanjun Gui, Wenyu ZhangData Sci. Eng 2016

Abstract

Apache Storm is a widely used platform for low-latency stream processing, yet its low-level programming model presents a significant barrier to developer productivity. This paper introduces POS (Pig On Storm), a high-level abstraction layer that brings the declarative simplicity of Pig Latin to the Storm ecosystem. POS utilizes a multi-stage compiler and a specialized in-memory state engine to translate high-level scripts into efficient Storm topologies. Evaluation on production data at Tencent Inc. demonstrates that POS drastically reduces code complexity with a manageable performance overhead of approximately 13%.

Introduction

Real-time stream processing is essential for modern data-driven applications, yet frameworks like Apache Storm require developers to manually manage "spouts" (data sources) and "bolts" (processing units). This low-level approach leads to high maintenance costs and a steep learning curve. While Apache Pig simplified batch processing on Hadoop, its original design was unsuitable for the unbounded, high-velocity nature of streaming data. POS addresses this by porting the Pig Latin language to Storm, introducing streaming-specific primitives and an automated compilation pipeline.

The POS System Architecture

The POS architecture consists of three primary components: a high-level user interface, a multi-stage compiler, and an execution environment integrated with an in-memory storage engine.

The POS system architecture, illustrating the pipeline from high-level script to executable Storm topology.

The compiler transforms scripts through four stages: parsing into an Abstract Syntax Tree (AST), generating a logical plan, creating a physical plan, and finally producing the executable Storm topology. To maintain low latency, POS incorporates an In-Memory Key-Value Engine (KVE). This distributed cache stores intermediate states, enabling complex operations like windowed aggregations without the bottleneck of disk I/O.

Stream Processing with Extended Pig Latin

POS extends the standard Pig Latin syntax to accommodate streaming requirements. New operators include TAP for live data ingestion, WINDOW for temporal aggregations, and PARTITION/BIND for managing data flow across the cluster.

The translation process from (a) a POS script to (b) a logical plan and finally (c) a physical Storm topology.

As shown in the figure above, a concise script can represent a complex data flow. The compiler automatically handles the "code tax" of wrapping data into tuples and managing the connections between processing units. This allows a 2,000-line Java program to be replaced by fewer than 20 lines of POS script, significantly increasing developer velocity.

Performance and Production Evaluation

The system was rigorously tested using standard benchmarks and real-world production data from Tencent Inc., where it processed over 5 billion tuples daily. Key findings include:

  • Efficiency: Simple operators like FILTER and FOREACH incurred only a 1.1x to 1.14x slowdown compared to hand-written Java.
  • Complexity Overhead: More intensive relational operations like GROUP and ORDER showed a 1.5x to 1.75x slowdown due to coordination requirements.
  • Production Viability: In large-scale deployment, the overall efficiency drop was a mere 13%, a trade-off deemed highly acceptable by engineers given the massive gains in code maintainability.

Conclusion and Future Work

POS successfully bridges the gap between high-level dataflow languages and real-time processing performance. While the current system uses static topologies, future work focuses on developing a cost-based optimizer and implementing dynamic re-partitioning to handle fluctuating data volumes. By abstracting the complexities of Storm, POS enables rapid development of robust streaming applications without sacrificing low-latency performance.

Summary updated

BibTeX
@article{cui2016pos,
  author = {Bin Cui and Jie Jiang and Quanlong Huang and Ying Xu and Yanjun Gui and Wenyu Zhang},
  title = {{POS: A High-Level System to Simplify Real-Time Stream Application Development on Storm}},
  journal = {Data Sci. Eng.},
  year = {2016},
  doi = {10.1007/s41019-015-0002-9},
}
Figure