Why it matters

Wrong windowing produces wrong results. Understanding the options matches business needs to technical impl.

Advertisement

The architecture

Tumbling: fixed-size, non-overlapping. Every 5 min: window 0-5, 5-10, etc.

Sliding: fixed-size, overlapping. Every 1 min compute 5-min stats.

Session: gap-based. Group events until N-min gap.

Window typesTumblingfixed, non-overlapSlidingfixed, overlapSessiongap-based dynamicGlobal windows accumulate forever; typically combined with custom trigger
Common window types.
Advertisement

How it works end to end

Event-time: window based on event timestamp. Handles late data via watermarks.

Triggers: when to emit results. On watermark, on count, custom logic.

Late data: past watermark. Discard, side output, or allowed lateness.

State: window operator maintains state per window.