REDIS INTERNALS Cover & Contents Contents Cheatsheet

A Source-Code-Oriented Guide

REDIS
INTERNALS

Programming ideas behind the code: the event loop, the object encodings, the incremental rehash, the fork-and-forget snapshot — the small, clever decisions that make Redis fast, simple, and predictable. Chalk it up, one board at a time.

A chalkboard illustration of a single glowing loop encircling small icons of a key-value pair, a clock, and a stack of disks, with chalk dust drifting off the board
Image needed

A warm, hand-drawn chalkboard illustration for the cover of a programming book called "Redis Internals": a dark slate-green chalkboard background with a single glowing circular loop (an event loop) drawn in chalk-white, orbited by three small simple chalk-drawn icons evenly spaced around its circumference — a key-and-value tag, a small clock face, and a stack of disks (representing persistence) — connected to the loop by thin dashed chalk lines. Soft pastel chalk colors only: chalk-white, warm gold, dusty blue, sage green, soft pink — no other colors. A light scatter of chalk dust and faint eraser smudges near the bottom edge for texture. Flat, hand-drawn, illustrative style like real chalk on slate (not photorealistic), no text or lettering baked in, generous empty margins. Target size ~1280x720px, 16:9 landscape; compose for a small on-page figure with the subject centred and safe margins — it is letterboxed into a 16:9 box, so keep nothing important near the edges.

Generate this with your image agent, then drop the file here.

Cover art slot. Drop your generated cover here — the book works fine without it.

Contents

  1. What Redis Is Really Optimizing For start here
  2. The Event Loop: One Thread, Thousands of Clients the ae library
  3. Anatomy of a Request: Socket to Reply the full trip
  4. The Object Model: One Struct, Many Encodings robj & strings
  5. Collections in Disguise: Lists, Hashes, Sets, Sorted Sets compact by default
  6. Dictionaries and Incremental Rehashing no stop-the-world resize
  7. Command Dispatch and Atomicity Without Locks MULTI, Lua, modules
  8. Persistence: RDB Snapshots and the Append-Only File fork & forget
  9. Replication and Clustering: Scaling Beyond One Box PSYNC & hash slots
  10. Expiration, Eviction, and the Housekeeping Cron good-enough, cheaply
  11. Why Redis Is Fast (and How to Watch It) slowlog & friends
  12. How to Reason Like a Redis Engineer patterns to steal
  13. The Cheatsheet encodings, tradeoffs, glossary
How To Read

Use and to turn pages, to jump back here. Every chapter opens with a runnable redis-cli example before it explains the C code underneath — that's the whole point of this book: Redis is small, readable, clever software, and the goal is to leave you itching to go build something of your own.

⌂ Library