This is Technical Insights Series by Perry Ma | Product Lead, Real-time Compute for Apache Flink at Alibaba Cloud.
Imagine an alarm system: sometimes you want to wake up at a fixed time (like 7 AM), sometimes after a specific duration (like 8 hours), and sometimes when there's enough sunlight. In daily life, these wake-up conditions can be freely combined - like "ring at 7 AM or after 8 hours of sleep, whichever comes first."
Triggers in Flink are like such an alarm system, determining when to process data. Unfortunately, the triggers at that time weren't as flexible - they couldn't combine multiple conditions like an alarm clock. FLIP-9 aimed to solve this problem, making trigger rule writing as simple and intuitive as setting an alarm. However, this proposal was ultimately shelved - why?
These triggers were usable but had two obvious limitations:
Like an alarm clock that can only set either "fixed time" or "timer" alarms, but not "ring at fixed time or when timer expires, whichever comes first." In Flink, you couldn't combine conditions like "data accumulates to a certain amount" and "reaches a certain time point."
Suppose the alarm rang but you didn't wake up - should it keep ringing or wait for the next time? Similarly with delayed data. While the system allowed setting a wait time, you couldn't specify special handling rules for these "late" arrivals. It's like not being able to set a rule like "if I don't wake up the first time, ring every 5 minutes until I do."
FLIP-9 proposed a more flexible approach:
New Basic Triggers:
Combination Methods:
Two Processing Modes:
This proposal was ultimately shelved for several main reasons:
The case of FLIP-9 shows that some ideas, while looking good on paper, might face unexpected difficulties in implementation. Sometimes, keeping things simple is the wiser choice. Although this proposal wasn't adopted, the problems it discussed and the decision-making process provided good references for subsequent improvements.
If you're using Flink now, you can implement special trigger requirements through custom triggers. While this might require writing more code, it's actually more flexible and easier to understand and maintain.
185 posts | 49 followers
Followdigoal - June 28, 2021
Alibaba Cloud Storage - June 4, 2019
Alibaba Cloud Serverless - August 21, 2019
digoal - May 28, 2021
digoal - June 25, 2021
digoal - March 25, 2020
185 posts | 49 followers
FollowRealtime Compute for Apache Flink offers a highly integrated platform for real-time data processing, which optimizes the computing of Apache Flink.
Learn MoreAlibaba Cloud provides big data consulting services to help enterprises leverage advanced data technology.
Learn MoreAlibaba 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 MoreConduct large-scale data warehousing with MaxCompute
Learn MoreMore Posts by Apache Flink Community