Part 7 of 18
Caching
5 pages · 5 written
- 1.Caching FundamentalsBasic
What a cache is and why it works: hit ratio, the layers where you can cache, query vs object caching, TTLs, what not to cache, and sizing with the 80/20 rule.
- 2.Caching Strategies: Cache-Aside, Read-Through, Write-Through, Write-BehindIntermediate
How reads and writes flow through a cache: cache-aside, read-through, write-through, write-behind, write-around, refresh-ahead, and when to use each.
- 3.Cache Eviction and InvalidationIntermediate
Which entries a full cache drops (LRU, LFU, FIFO, random, TTL, W-TinyLFU) and how to remove stale ones: TTL, delete, versioned keys, CDC, and cache/DB races.
- 4.Cache Failure Modes: Stampedes, Hot Keys and PenetrationAdvanced
How caches fail and take databases down: stampedes, penetration, avalanches and TTL jitter, hot keys, big keys, cache outages and warming and their fixes.
- 5.Distributed Caching with Redis and MemcachedIntermediate
Running a cache across many nodes: client, proxy and server-side sharding, Redis vs Memcached, replication and failover, Meta-style invalidation, tiers, cost.