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

Play it as a journeyTutor comes with a plan

Build Your Own Redis, From Scratch

The Map
The Map · Open board

The nine boards of this build, one wall at a time, in the order they showed up.

Before you start. You need to know that a running program holds data in its own memory, and that memory empties the moment the program stops. That gap is what this lesson bridges.

Boards

Code: teaching/code/from-scratch/redis/: one Go module, each stage runs alone: go run ./01-socket … go run ./07-persistence. Poke it with redis-cli -p 6379 …. Then go run ./08-whole runs all seven as one server, with expiry, eviction and persistence live at once.

Lesson 2 of 117 in From Scratch · Free with an account

Keep reading. It's 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.

No card, and chalk sends no email. Google sign-in only.

Start free with Google

In this lesson

  • 2007, Sicily: a notepad that could not keep up
  • 2009: skip the filing cabinet, write the notepad
  • The walls, in the order they showed up
  • The line to talk on: a socket
  • Saying the length before the word: RESP
  • A page that finds itself: the map
  • One clerk, a thousand voices: the event loop
  • Notes that expire, a desk that fills, an office that could lose power
  • One SET, end to end
  • What you can run today
  • Go, as you go (new-to-Go markers)

Terms it explains: socket, RESP, map, event loop, log, or, randomized.

Review From Scratch