Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 04 · From Scratch · Kafka · with code: Go · about 32 min to read

Play it as a journeyTutor comes with a plan

Kafka 08: Everything

Everything
Everything · Open board

The finale of the Kafka build, tying together everything before it and closing out Build Your Own Kafka, From Scratch.

Before you start. This series builds a small copy of Kafka, a program that lets one part of a system hand a stream of events to many other parts without losing any of them, even if a reader falls behind or a machine restarts. Picture it as a newsroom’s shelf of published articles. So far the copy can do four things. It writes every article onto the shelf and never removes one when someone reads it. It splits the shelf into several side-by-side shelves when one gets too busy. It keeps spare copies of each shelf in other rooms, in case one room burns down. And it lets several teams read the same shelf at their own pace, each keeping its own bookmark. This lesson doesn’t add a new piece. It follows one single event all the way through, so you can watch everything built so far work as one machine instead of several separate ideas.

Lesson 31 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.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 2017: sixteen million articles, one log
  • One article, filed once
  • Why one shelf isn’t enough: partitions
  • The one machine that writes, and the waterline that says it’s safe
  • Two crews, one shelf, no collisions
  • One trip, start to finish
  • Four ideas, and how they lean on each other
  • Every choice was a fork
  • The five ways it breaks, and what each one is really telling you
  • What real Kafka adds on top
  • Run the whole thing
  • Check every stage
  • Where next

Terms it explains: offset, partition, leader, replica, group, sticky, segments, sparse index, in-sync set, log end offset, high-water mark, inside, compacted, Commit after processing, rebalance, Kafka docs: Design, Kafka docs, Implementation, The Kafka source.

Related paper

Review From Scratch