Redis Course
Model data in Redis, cache without stampedes, lock without lying, and know exactly what a crash costs you.
Take this course in the learning hubLessons
- What Redis is and when it beats a databaseRedis is an in-memory data structure server, which buys latency and costs you durability.
- The core data types and what each is forChoosing the right Redis type removes application code rather than adding it.
- Key design, expiry and what TTL really returnsA key is your only index in Redis, and a TTL is the only thing stopping it living forever.
- maxmemory and the eight eviction policiesWithout maxmemory Redis grows until the kernel kills it, and the default policy refuses writes rather than evicting.
- Cache-aside, write-through and invalidationCache-aside is the default pattern because it fails safe: a cache outage becomes a slow request, not a wrong one.
- Cache stampede and the thundering herdOne expired key can send every concurrent request for it to the database in the same millisecond.
- Atomic operations and why INCR is not GET plus SETRead-modify-write from the client loses updates; the same work inside one command cannot.
- MULTI/EXEC versus Lua scriptsA Redis transaction batches commands; a Lua script is the only way to branch on a value atomically.
- Distributed locks and why naive SETNX is wrongA Redis lock is a lease that can expire while you still believe you hold it.
- Pub/Sub, Streams, and how both differ from KafkaPub/Sub forgets instantly, Streams remember until you trim, and neither is a distributed log.
- RDB, AOF, and what a crash actually costsSnapshots lose everything since the last one; the append log loses at most a second - and both cost you something.
- Replication, Sentinel and ClusterReplicas give you reads and failover; only Cluster gives you more memory than one machine has.
- Redis from Spring BootThe starter gives you a template and a cache manager, and both have a default that surprises people.
- Spotting a bad Redis usageMost Redis incidents are one of four mistakes, and all four are visible from redis-cli in a minute.
- Where the memory actually goesEncodings, per-key overhead, and why 1M small keys costs far more than the data.
- Cluster mode, hash slots and hash tagsWhat breaks when one node becomes many, and how to keep related keys together.
- Where Redis latency comes fromIt is single-threaded, so one slow command stalls everyone.
- Why your Redis lock is probably not safeThe correct implementation, its real guarantees, and when it is not enough.
- Persistence, replication and what a failover losesRDB versus AOF, and the acknowledged writes that still disappear.