Discussion about tumbling and Sliding window wrt FLINK
In Apache Flink, Tumbling Windows and Sliding Windows are two types of windows that organize and process streams of data over specific time intervals. They are commonly used in stream processing .
1. Tumbling Window
A Tumbling Window divides the data stream into fixed, non-overlapping chunks of time or count intervals. Each event belongs to exactly one window.
Characteristics:
Fixed size: The duration or count of each window is predefined.
No overlap: Consecutive windows do not overlap; an event is part of only one window.
No gaps: The windows cover the entire data stream.
Use Cases:
Scenarios where non-overlapping intervals are required, e.g., hourly sales totals, daily traffic analysis.
|----Window 1----|----Window 2----|----Window 3----|
2. Sliding Window
A Sliding Window allows overlapping intervals by defining a window size and a slide interval. Events can belong to multiple windows if the intervals overlap.
Characteristics:
Fixed size: The window size remains constant.
Overlapping: Windows overlap if the slide interval is smaller than the window size.
Overlap/Gap: The amount of overlap or gap depends on the difference between the window size and slide interval.
Use Cases:
Scenarios requiring continuous or overlapping analysis, e.g., rolling averages, trend detection.
|----Window 1----|----Window 2----|----Window 3----| |----Window 4----|----Window 5----|
Source:- wikipedia