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 11 · From Scratch · Raft · with code: Go · about 10 min to read

Watch: Consensus: who holds the pen
▶ VideoPlay it as a journeyTutor comes with a plan

Raft Capstone: Everything

Who Holds the Pen
Who Holds the Pen · Open board

The System Design episode on who holds the pen. This capstone is the pen, built: one holder at a time, a record the others can check, and a way to hand it over. Closes the Raft series, Build Your Own Raft.

Before you start. This series built a small copy of Raft in four stages. By now your five nodes can: pick one leader by numbered terms and votes (Raft 01: Leader Election). Copy the leader’s log to a majority and overwrite what conflicts (Raft 02: Log Replication). Write their term, vote and log down before they reply, and come back from a power cut (Raft 03: Persistence). And serve a key-value store whose clients can retry safely (Raft 04: A Key-Value Store on Top). This lesson follows one command through all of it, then runs the whole thing under random failure.

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

  • 17 October 2026: what the real thing says it is for
  • One command, start to finish
  • Run everything
  • The same Raft, four times
  • What the chaos tests check
  • What this build still lacks

Terms it explains: The leader counts, commit, consensus, election timeout, heartbeat, leader / follower / candidate, log entry, Paxos, quorum / majority, Raft, split-brain fence, term.

Lab

The room splits in two. Both halves think they are in charge. Who is allowed to write?

Stay on Whoever asks first, press Add next write to the end of the night, and watch The bill so far.

Open Who holds the pen

Related papers

Review From Scratch