PrepCity

Event-time windows

Open the lab

By the last page, this is the design you will have built. Drag it, or Show all, to see every part.

Lesson · 5 pages · about 4 min

Event-time windows

Count each order in the window of the minute it happened, not the minute it reached you. Late phones make the difference, and keeping windows open for them has a cost.

What it is
A way of adding up a stream of events in slices of time, like five minutes, by when each event really happened.
What it is for
Events reach you late and out of order. Counting by arrival puts sales in the wrong slice; counting by event time keeps totals true.
Use it when
Whenever a stream’s totals must match what really happened: sales per hour, clicks per minute, readings per sensor.
Not when
When you want to know how busy your own system is right now: then arrival time is the honest measure.

Words you’ll learn

  • Stream processor
  • Time window
  • Dashboard
  • Stream
  • Arrival time
  • Data pipeline
  • Event
  • Event time
  • Late event
  • Allowed lateness

Page by page