Start here
Crashes and retries happen in every stream. This chapter shows what each one does to your data, and how to keep the result right.
What you already know
- Kafka keeps events in a log. A topic is split into partitions, and each event has an offset.
- A committed offset is the offset of the next record to read. Lag is how far a reader is behind.
- Order exists only inside one partition. The same key goes to the same partition.
- The chapter Idempotency, Retries & Exactly-Once showed how to make a repeated write harmless.
What you will learn
- At-most-once and at-least-once, as a crash on the shop stream.
- What exactly-once really means.
- How Kafka transactions work, and where they stop.
- How to remove repeats with a time window.
- What can break order inside a partition.
- How to keep the newest version of a row when events arrive out of order.
- What to do with a message that always fails.
- Which guarantee to pick for which data.
We use the same shop and the same made-up day, 2026-01-22. This table shows where the orders from the last chapter are stored:
| Partition | Offset 0 | Offset 1 | Offset 2 | Offset 3 |
|---|---|---|---|---|
| p0 | order 110 | order 114 | order 150 | (none yet) |
| p1 | order 111 | order 112 | order 113 | order 151 |
