Building Scalable Streaming Pipelines for Near Real-Time Features

Feng Xu, Gang Zhao
19 min readadvanced
--
View Original

Overview

The article discusses the challenges and solutions in building scalable streaming pipelines for generating near real-time features at Uber. It highlights the use of Apache Flink for real-time data processing, performance tuning strategies, and the architecture of the streaming pipelines.

What You'll Learn

1

How to leverage Apache Flink for real-time data processing

2

Why performance tuning is critical for streaming pipelines

3

How to implement the Kring Smooth algorithm for geospatial data aggregation

Prerequisites & Requirements

  • Understanding of streaming data processing concepts
  • Familiarity with Apache Flink and Kafka(optional)

Key Questions Answered

What are the main challenges in building scalable streaming pipelines?
The main challenges include managing high data volumes, ensuring low latency, and handling complex computation logic. These factors can lead to performance issues such as backpressure and out-of-memory errors, which need to be addressed for a stable pipeline.
How does the Kring Smooth algorithm work?
The Kring Smooth algorithm aggregates event counts from a hexagon and its neighboring hexagons, allowing for geospatial data analysis. It calculates feature values by considering events within defined rings around a hexagon, enhancing the accuracy of demand and supply features.
What optimizations were applied to improve the streaming pipeline's performance?
Optimizations included enabling object reuse, adjusting job parallelism, and implementing a customized sliding window to reduce overhead. These changes significantly improved write throughput and reduced latency in the pipeline.
What was the impact of batching on write QPS?
Batching improved write QPS significantly, with configurations achieving up to 120k writes per second. Adjustments to batch sizes and partitioning strategies were crucial in optimizing throughput during data ingestion.

Key Statistics & Figures

Average input rate of Kafka topics
120k/s
This rate reflects the volume of data processed in the demand pipeline.
Write QPS after optimization
120k
This was achieved by adjusting job parallelism and batch sizes.
Total estimated memory for states
136G
This estimation is based on the number of hexagons, product types, and event sizes.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Implementing a customized sliding window can drastically reduce overhead in streaming pipelines.
By managing state in memory and reusing objects, the pipeline can handle higher data volumes without lag, making it essential for real-time applications.
2
Regularly monitor and tune the performance of your streaming jobs to prevent backpressure and memory issues.
Using tools like Uber's uMonitor system can help identify bottlenecks and optimize resource allocation effectively.
3
Consider using a dedicated cluster for high-volume streaming jobs to avoid resource contention.
Shared clusters can lead to unpredictable performance; a dedicated environment allows for better resource management and stability.

Common Pitfalls

1
Failing to monitor for backpressure can lead to severe performance degradation.
Backpressure occurs when the system cannot process incoming data fast enough, causing delays and potential data loss. Regular monitoring and tuning are essential to maintain performance.
2
Overlooking the importance of batching can result in lower throughput.
Batching allows for more efficient data handling, but improper configurations can lead to bottlenecks. It's crucial to find the right balance for batch sizes to optimize performance.

Related Concepts

Streaming Data Processing
Performance Tuning In Data Pipelines
Geospatial Data Aggregation Techniques