Before you start. This series builds a small copy of Kafka, a program that keeps a stream of events and lets many other programs read that stream at their own pace, the way LinkedIn built the real Kafka to move data between its own services. The last stage built a mailbox queue where the first program to read a message deleted it for everyone else, and that one habit broke it three ways: a second reader found the box empty, a crash lost everything still sitting in it, and a slow reader forced you to either drop messages or make the sender wait.
Lesson 25 of 117 in From Scratch
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
December 2013: a name for a fix that already existed
The rule: stop treating a read as a write
A number instead of a name: the offset
Two readers, two bookmarks, one log
Why nothing gets deleted, and what it costs instead
An offset is a position, not an id
The consumer owns the cursor
Why append-only is fast
Durability, and what Kafka actually does
Retention: age and size, never acknowledgement
Build it
Where one file and one machine stop
Terms it explains: log, offset, lag, schedule, retention, id, "Everything after X", partition, N independent readers, TLS defeats it, not, replication across brokers, policy about the file, compaction, loses data, last, Partitions, progress is subtraction, Sequential writes, loses data permanently.