10 parts · 12 chapters
Redis and Caching
Redis is a data structure server in memory: strings, hashes, lists, sets, sorted sets and streams, each with operations that run in microseconds. Measured on this machine (Redis 8.6.2): about 170,000 simple operations per second from 50 clients at a median of 0.15 ms, and 1.8 million GETs per second with pipelining.
Ten parts: why Redis; data structures and their memory encodings; the single-threaded core and IO threads; persistence with RDB and AOF; eviction and memory; replication, Sentinel and Redis Cluster; Lua, functions, transactions and pipelining; streams, pub/sub and Redis as a queue; patterns (locks and the Redlock debate, rate limiters, leaderboards, sessions); and operating Redis, including the Valkey fork.
structuresStrings, hashes, lists, sets, sorted sets, streams, HyperLogLog, bitmaps, JSON.
the coreOne thread for commands, an event loop, IO threads, and why it is fast.
durabilityRDB snapshots, AOF with fsync policies, and what you can lose.
memorymaxmemory, eviction policies, encodings, fragmentation.
scaleReplicas, Sentinel failover, Cluster with 16,384 hash slots.
patternsCaching, locks, rate limiting, queues, leaderboards, sessions.
00
Why Redis
A data structure server, measured · Uses, licensing and limits
2 ch · ~12 min01Data Structures and Encodings
Structures and how they are stored
1 ch · ~8 min02The Single-Threaded Core
One thread, one loop
1 ch · ~8 min03Persistence
Snapshots, logs and loss windows
1 ch · ~8 min04Eviction and Memory
Eviction, expiry and fragmentation
1 ch · ~8 min05Replication, Sentinel and Cluster
High availability and sharding
1 ch · ~8 min06Lua, Functions, Transactions and Pipelining
Atomic logic and fewer round trips
1 ch · ~8 min07Streams, Pub/Sub and Redis as a Queue
Queues, pub/sub and streams
1 ch · ~8 min08Patterns
Locks and fencing · Rate limiters, leaderboards and delayed jobs
2 ch · ~12 min09Operating Redis and Valkey
Running it
1 ch · ~8 minBuilt on Scaling and Distributed SystemsScaling Databases part 4 covered caching patterns; Distributed Systems parts 11 and 12 covered cache invalidation and hash slots. The BYO course built a mini Redis; this course covers the real one.