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

Kafka 01: The Naive Queue

The Naive Queue
The Naive Queue · Open board

The first board in the Kafka build, and the only one whose job is to fail.

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. Build Your Own Kafka, From Scratch set that goal. This lesson builds the plainest version of the idea, and breaks it three times on purpose, so the fix in the next lesson feels necessary instead of clever.

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

  • 2003: a bank that cannot afford to lose a message
  • The queue you would build first
  • Wall 1: the second consumer finds nothing
  • Wall 2: a restart loses everything
  • Wall 3: one slow consumer jams the line for everyone
  • The fix hiding in the queue: a log, and an offset
  • What the three walls have in common

Terms it explains: queue, producer, consumer, offset, log, starting second, Unbounded, Bounded, head-of-line blocking, (1) Retain every message.

Related paper

Review From Scratch