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 16 min to read

Play it as a journeyTutor comes with a plan

Build Your Own Kafka, From Scratch

The Map
The Map · Open board

The whole build laid out as one map, in the order each stage’s own problem forces the next.

Before you start. This series builds a small copy of Kafka: a program that keeps a list of everything that happened, in order, and lets any number of programs each read that list from wherever they left off. You need to know only that a file is a named place on disk you can add bytes to and read back later. If you’ve already built the first system in this track, you’ve seen the same length-prefixed record trick this one reuses.

Code: teaching/code/from-scratch/kafka/: one Go module, each stage runs alone: go run ./01-queue … go run ./07-semantics. 02 and 03 write real log/segment files you can inspect and delete.


Lesson 23 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

  • 2010: LinkedIn, and a pipe for every pair
  • The bet: a shared notebook instead of a pipe per pair
  • First try: a queue, and the note that gets torn out
  • The fix: a log, and a page number that’s yours to keep
  • One shelf isn’t enough: partitions, a broker, and a reading group
  • What’s still ahead: a fire, and the same note twice
  • What you can run today
  • The nine lessons
  • Go, as you go

Terms it explains: offset, log, partitions, broker, consumer group, segments, sparse index, Retention, Per partition only, two, three, eight sit idle, group, committed offset, rebalance, leader, follower, ISR, high-water mark, idempotent producer, sequence number, Transactions, deletes on read, retains, prune and seek, key, acks=all, guarantees, plus dedup, KIP-98.

Review From Scratch