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 · From Scratch · Redis · with code: Go · about 18 min to read

Play it as a journeyTutor comes with a plan

Surviving a Crash (Persistence)

Surviving A Crash (Persistence)
Surviving A Crash (Persistence) · Open board

The persistence stage of the Redis build in From Scratch, right after Eviction: Memory Is Full taught the toy what to do when memory runs out, and sitting inside the project lesson Build Your Own Redis, From Scratch. This one is about what happens when the machine itself disappears.

Before you start. The six stages before this one built a key-value store that keeps every key in RAM, fast because RAM never has to wait on a disk, and forgetful because RAM empties the instant the power does. You already have keys that expire on their own and a rule for what dies first when memory fills up. This stage is about the one failure neither of those covers, the machine turning off.

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

  • 2018: the crash that “fsync succeeded” couldn’t explain
  • Two different bets on what a crash can take from you
  • How do you photograph ten gigabytes without stopping the world?
  • The diary, and the one dial that decides how much you lose
  • Why Redis is allowed to break the rule a real log can’t

Terms it explains: RDB, AOF, fork, appendfsync, AOF rewrite, page table, that one page, already-acknowledged, ever performed, effects, not intentions, diary only, disabling transparent huge pages.

Review From Scratch