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 02 · System Design · When the stalls must agree · about 25 min to read

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

Who holds the pen (consensus & Raft)

Who Holds the Pen
Who Holds the Pen · Open board

The System Design spine’s episode on who is allowed to write. The copy clerks (database replication) said the stall may have “only ONE new master” and never said who picks it. This is who picks it, and what the picking cannot protect.

Before you start. The stall in this lesson is the chai stall the System Design spine has been running: five clerks behind the counter, each keeping a copy of the register in a book of their own, and one pen that decides who is allowed to write in it. The copy clerks (database replication) is where those clerks came from, and The cut phone line (CAP, done properly) is the rule that when the wire between two copies is cut, you must choose between answering and being right.

Lesson 8 of 115 in System Design

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

  • October 2018: forty-three seconds, and GitHub was wrong for a day
  • 1975: two gangs, one messenger, and a proof that it cannot be done
  • The trick: a majority, because any two majorities share a member
  • 1990: Paxos, the right answer that nobody could read
  • 2014: Raft, built so you could hold it in your head
  • Back to GitHub: the fence Raft does not give you

Terms it explains: majority, consensus, term, committed, fencing token, broadcastTime, electionTimeout, MTBF, Row 3, Row 4, Row 5, earlier terms, The register accepts it, its own current term, width, 100%, commit, election timeout, heartbeat, leader / follower / candidate, log entry, Paxos, quorum / majority, Raft, split-brain fence.

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 System Design