← All labsStreaming & event time

Streaming & event time

Watermark Tide

Fire tumbling, sliding, and session windows, then throw a late event over the watermark.

How to read this lab

A stream of events arrives out of order — some show up late relative to when they actually happened. Windows seal (fire) the instant the watermark passes their end boundary, and once sealed they're immutable: any event that arrives after that gets routed to dead-letter instead of silently changing the result.

Controls

Tumbling / Sliding / Session
Picks the windowing strategy: fixed non-overlapping buckets, fixed overlapping buckets, or gap-based sessions that merge when events land close together in time.
Allowed lateness
How far behind the latest-seen event time the watermark trails. Lower means windows seal sooner but tolerate less lateness.
Gap timeout / Window size
The window's size (tumbling/sliding) or the inactivity gap that closes a session — the label switches to match the selected strategy.

What to watch for

  • Watch the watermark tide line sweep across, sealing window panes as it passes their end boundary.
  • Drag Allowed lateness down — Dead letters climbs, because more real (just slightly late) events now arrive after their window has already sealed.
  • A late event landing after its window fired never changes that window's already-emitted count — it's counted in Dead letters instead.

Why it happens

The watermark is the system's best guess at "we won't see anything earlier than this, minus some slack for stragglers." A window only fires once the watermark passes its end — not on a timer, not on event count. Tightening the lateness allowance makes the watermark less patient, so it declares windows "done" sooner, which means more real, only-slightly-late events arrive too late to count and get silently dropped instead. This is the exact tradeoff every real stream-processing system (Flink, Beam, Spark Streaming) makes explicit: wait longer for stragglers, or emit sooner and accept more loss.

Try this first — Set Allowed lateness to its minimum and watch Dead letters climb faster than at the default.

Warming up…

The stream just (re)started replaying in arrival order — give the watermark a moment to climb before the first window can fire.

  • On-time (accepted)
  • Late but accepted
  • Dead-lettered (too late)
  • Open window pane
  • Sealed window pane
  • Watermark tide line
Seed1

Window type

Parameters

500 ms
1000 ms

The watermark trails the max event time seen so far by the allowed-lateness slider. A window fires the instant the watermark reaches its end — tighten the slider and watch dead-lettered (red) events pile up as genuinely late data gets silently dropped instead of counted.

Windows fired

0

of 20 total

Dead letters

0

Late events routed away from sealed windows

Watermark

0ms

maxEventTime − allowedLateness

Sweep progress

0%

0 / 25193 ms arrival time