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

Play it as a journeyTutor comes with a plan

Redis 02: RESP, The Wire Protocol

RESP The Wire Protocol
RESP The Wire Protocol · Open board

The label that lets a stranger’s bytes say, before you read a single one of them, exactly how many there are.

Before you start. You need to be able to count the characters in a word and add two small numbers: that’s the whole of the arithmetic here. The toy so far is a program that listens on a network connection (a socket: one open line between two programs, carrying bytes both ways), reads one line of text at a time and answers it, and it only works today because whoever is typing presses Enter after every word, the way a person would, not a program.

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

  • The mailroom problem
  • 1982: the letter that ends at one dot
  • Framing: naming the job both of them are doing
  • RESP: the number on the envelope
  • Binary-safe: what the number buys you
  • Every command is a stack of bulk strings, one shape, always
  • The letter arrives in two trucks

Terms it explains: framing, frame, RESP, binary-safe, bulk strings, parser, push, The incremental parser, Writing replies, not, consume nothing, request, reply, inline commands.

Review From Scratch