This is Technical Insights Series by Perry Ma | Product Lead, Real-time Compute for Apache Flink at Alibaba Cloud.
Imagine a crowd control system in a massive shopping mall. Sometimes, customers need to pass through the same area multiple times (like the food court), and different areas generate inter-area foot traffic. The current system has a problem: it either sets a fixed waiting time for each area or doesn't know when to close. This approach clearly isn't flexible enough. FLIP-15 aims to solve this problem by enabling the system to handle such circular flow scenarios more intelligently.
The existing Flink stream processing iteration model has three main problems:

| Problem | Manifestation | Impact |
|---|---|---|
| Unstructured Loops | Can add feedback edges arbitrarily, no scope restrictions | Hard to ensure correctness, difficult maintenance |
| Unreliable Termination | Depends on fixed timeout | May end too early or wait too long |
| Poor Backpressure Handling | Circular data flows prone to deadlock | Affects system stability |
The new solution is like designing an intelligent management system for the shopping mall, with three main improvements:

Each loop has its own "territory," like functional areas in a shopping mall:

The new API is designed to be more intuitive and safe. Here's an example analyzing mall customer flow:
// Define loop logic
DataStream<Customer> result = customerFlow.iterate(new LoopFunction<Customer, Customer>() {
@Override
public Tuple2<DataStream<Customer>, DataStream<Customer>> loop(DataStream<Customer> input) {
// Analyze customer flow
DataStream<Customer> analysis = input.map(new AnalyzeCustomerFlow());
// Feed part of customer flow back to loop start
DataStream<Customer> feedback = analysis
.filter(new NeedsRecheck())
.map(new PrepareForNextIteration());
// Return streams for continued processing and final results
return new Tuple2<>(feedback, analysis.filter(new IsComplete()));
}
});
Instead of relying on fixed timeouts, it uses distributed coordination to determine when to end processing:

For loop scenarios, two strategies are provided for handling backpressure:
| Strategy | Advantages | Disadvantages | Suitable Scenarios |
|---|---|---|---|
| Feedback Priority | Strong predictability, avoids disk writes | May reduce throughput | Low latency requirements |
| Dynamic Priority | High overall throughput | Single iteration latency may increase | High throughput requirements |
This FLIP has an interesting development history. Initially aimed at solving iteration problems in the DataSet API, the entire iteration processing architecture has evolved with Flink:
Early Stage: The FLIP proposed two main prototype branches:
Architecture Transition: Since Flink 1.12, the DataSet API has been soft-deprecated, with official recommendations for:
Current Recommendations: For scenarios requiring iteration functionality:
In distributed environments, iteration computation introduces an important concept: Superstep Synchronization.

This synchronization mechanism ensures:
After implementing this improvement, note the following:
FLIP-15 makes Flink more reliable and efficient in handling stream loops by introducing loop scopes and smart termination mechanisms. It's like upgrading a shopping mall's intelligent management system, accurately monitoring each area while flexibly controlling customer flow. This improvement eliminates fixed timeout limitations, provides a more elegant programming model, and resolves deadlock risks. Although still under development, it represents an important advancement in Flink's stream processing capabilities.
Building a Unified Lakehouse for Large-Scale Recommendation Systems with Apache Paimon at TikTok
206 posts | 54 followers
FollowApache Flink Community - June 6, 2024
Apache Flink Community China - March 29, 2021
Apache Flink Community - October 10, 2025
Apache Flink Community - August 1, 2025
Apache Flink Community - November 7, 2025
Apache Flink Community - March 13, 2025
206 posts | 54 followers
Follow
Realtime Compute for Apache Flink
Realtime Compute for Apache Flink offers a highly integrated platform for real-time data processing, which optimizes the computing of Apache Flink.
Learn More
Big Data Consulting for Data Technology Solution
Alibaba Cloud provides big data consulting services to help enterprises leverage advanced data technology.
Learn More
Big Data Consulting Services for Retail Solution
Alibaba Cloud experts provide retailers with a lightweight and customized big data consulting service to help you assess your big data maturity and plan your big data journey.
Learn More
Quick BI
A new generation of business Intelligence services on the cloud
Learn MoreMore Posts by Apache Flink Community