Start here
In "Streaming Architecture Fundamentals", producers wrote events to a log and consumers read them. This chapter is about what a consumer computes from those events.
A stream never ends. So you cannot say "count all the orders". You need windows, and you need a way to remember things between events.
What you already know
- Event time is when something happened. Processing time is when your job sees it.
- A late event arrives after events that happened later than it.
- A tumbling window is a fixed block of time, such as five minutes, with no overlap.
- A watermark is the newest event time seen, minus a wait. A window closes when the watermark reaches its end.
- A consumer reads events from a log, and its offset marks its place.
What you will learn
- Steps that remember (stateful) and steps that do not (stateless).
- Three kinds of window: tumbling, sliding and session.
- How the remembered data, called state, grows and shrinks.
- What a job can do with a late event.
- How to join a stream to a table, and a stream to a stream.
- How a checkpoint saves state, and how three engines name these ideas.
We keep the five shop orders from "Batch vs Streaming vs Micro-Batch", on the same made-up day, 2026-01-22. Look at both times for each order:
| order_id | customer_id | amount | Event time (placed) | Processing time (arrives) |
|---|---|---|---|---|
| 110 | 2 | 30.00 | 10:02 | 10:02 |
| 111 | 5 | 9.00 | 10:04 | 10:04 |
| 112 | 3 | 20.00 | 10:06 | 10:06 |
| 113 | 1 | 12.00 | 10:04 | 10:07 |
| 114 | 4 | 7.50 | 10:08 | 10:08 |
Order 113 is the late one. It was placed at 10:04, but it arrives at 10:07.
