Part 3
Redis and Caching
In-memory data structures, caching patterns and their failure modes, memory and eviction, persistence, replication, Sentinel, Cluster, pub/sub, and distributed locks.
Redis is the Swiss-army knife of the stateful tier: cache, session store, rate limiter, leaderboard, queue, and lock service, all in memory at sub-millisecond latency. It's simple to start and easy to misuse: most Redis outages come from treating a cache as a database, running out of memory, or one slow command blocking everything. (Valkey, the Linux Foundation fork used by ElastiCache and many distros, behaves the same for everything in this part.)
- 3.1
Data Structures and Caching Patterns
BeginnerRedis's core types and what each is for, TTLs, cache-aside vs write-through, invalidation, cache stampedes, and sessions and rate limiting in Redis.
45 min · 4 lab steps · 2 drills
- 3.2
Memory, Eviction, Persistence, and Slow Commands
Intermediatemaxmemory and eviction policies, big keys and hot keys, RDB snapshots vs AOF, fork and copy-on-write, the SLOWLOG, and the commands you should never run in production.
45 min · 4 lab steps · 2 drills
- 3.3
Replication, Sentinel, Cluster, Pub/Sub, and Distributed Locks
AdvancedAsync replication and its data-loss window, Sentinel failover, Redis Cluster hash slots and MOVED redirects, hash tags, pub/sub vs streams, and how (not) to build a distributed lock.
55 min · 4 lab steps · 2 drills