Tumbling, Sliding, and Session Windows

Compare three meanings of a time window and count how many aggregate states one observation can affect.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Fixed intervals can overlap or partition time
  2. Session windows depend on observed gaps

Fixed intervals can overlap or partition time

A tumbling window with length ten seconds defines disjoint intervals such as \([0,10)\) and \([10,20)\). An observation at time ten belongs to the second. A sliding window with length ten and advance five assigns a time-seven observation to \([0,10)\) and \([5,15)\). Overlap changes both the intended statistic and the number of aggregates affected per observation.

Session windows depend on observed gaps

A session can group activity for a key until a specified gap separates it. A late event between two apparent sessions may merge them under the event-time model. This requires state and an update contract that can revise older outputs. Event time states which clock drives grouping. Late data and retractions explain how an already emitted result can be corrected.[1][2]

References

  1. Tyler Akidau et al., The Dataflow Model ↩
  2. Apache Beam, Programming Guide ↩