Event Time vs Processing Time
People think the time on an event and the time it was handled are the same. Event time is when it really happened, stamped in the event. Processing time is when the system got to it. A late event has an old event time and a new processing time, so the two can put it in different windows.
Event Time
The time it really happened, not the time it came in.
Event time is the moment an event really happened, written into the event itself. It can differ a lot from the time the event reaches the system. A phone that is offline may send its events an hour late. A stream that groups by event time puts each event in the right window, even when it comes late. To do that, it needs a watermark.
Processing Time
The time the system handles an event, by its own clock.
Processing time is the clock time when the system handles an event. It is simple and needs no waiting, because the system already knows it. But it changes if the same data is run again, and late events land in the wrong window. It suits alerts that only care about now. Reports that must be right should use event time.
In one line
- Event Time
- The time it really happened, not the time it came in.
- Processing Time
- The time the system handles an event, by its own clock.