Event Time vs Processing Time
Watch delayed IoT events move through event-time windows, watermarks, and late-data policy.
Event time says when the sensor measured. Processing time says when the system found out.
The same reading can be created in one event-time window and arrive much later in processing time. The watermark is the processor's moving line for deciding which event-time results can close.
Factory line sensor
A steady local network with one buffered packet shows why event time and arrival order are not the same thing.
The first event has no previous high event-time mark, so it opens its event-time window.
How to read the trace
Top timeline: when the event happened at the device. Bottom timeline: when the processor received it. A long horizontal gap means the reading waited in a network, device buffer, or batch.
The watermark line sits on the event-time axis. If an older event arrives to the left of that line, the processor treats it as late and checks whether its event-time window is still inside the allowed lateness period.
Formula reference
| Quantity | Teaching formula |
|---|---|
| arrival lag | processing_time - event_time |
| watermark | max_event_seen - watermark_delay |
| window start | floor(event_time / window_size) * window_size |
| late accepted | event_time < watermark and watermark <= window_end + grace |
Production systems can use richer watermark strategies, but the core idea is the same: watermarks bound how long the system waits for older event times.
Design trade-off
- Small watermark delay: faster results, more old events routed to late handling.
- Large watermark delay: more complete results, slower window close times and more retained state.
- Allowed lateness: lets already emitted windows update for a while, but increases correction traffic and state lifetime.
What the animation simplifies
This component uses one ordered stream and one deterministic watermark formula. Real systems may track watermarks per partition, merge watermarks from several sources, emit early results, and send very late events to an audit or replay path instead of dropping them silently.