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

Play it as a journeyTutor comes with a plan

Raft 03: Persistence

Write-Ahead Log
Write-Ahead Log · Open board

The Database build’s write-ahead log board: write it down, make the note survive, then act. A Raft node does the same thing with three small facts. Part of the Raft series, Build Your Own Raft.

Before you start. This series builds a small copy of Raft, the algorithm a group of machines uses to keep one shared list of commands. Raft 01: Leader Election picked a leader by votes and Raft 02: Log Replication copied its log to a majority. Both ran with every node held in memory. This stage makes a node able to be switched off and back on. The reasoning about “write it, then make it survive” is the one from Write-Ahead Log, including what fsync really promises.

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

  • 23 June 2020: a log that could not be read back
  • Why exactly those three
  • What goes on disk
  • Where save is called
  • Restart
  • The power cut
  • The tests
  • Break it, three ways

Terms it explains: current term, voted for, log, ledger, Never write anything.

Related paper

Review From Scratch