AdvancedAbout 20 min

    Stream Processing: Time, Windows & Exactly-Once

    Read the full article on Substack

    7 min read.

    Count late, out-of-order events by event time, close one-minute windows with a watermark, and see why a crash double counts unless state and offset are saved together.

    Think of it this way: Postcards from a trip arrive at home out of order and some come weeks late. To know which day each was written, read the date on the card, not the day it landed. And at some point you stop waiting for more cards from Tuesday and stick that page in the album, adding a note if a late one turns up.

    now 10:00:00
    Arrived so far (label = when it happened)
    nothing yet
    Count by arrival time
    00:00–01:000open
    01:00–02:000open
    02:00–03:000open
    Count by event time
    00:00–01:000open
    01:00–02:000open
    02:00–03:000open

    Phones send "page viewed" events. Count views per minute, two ways: by when each event arrives, and by when it happened.

    1/8

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Event time or processing time?

    Sort

    Sort each statement by the clock it is about.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Event time

    Drop items here

    Processing time

    Drop items here
    6 pieces left to place

    Quiz

    8 questions
    Question 1 of 8
    Score: 0

    What is event time?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going