system design courseCaching
Why a database slows down under load, and how a copy in memory fixes it without lying to your users.
8 chapters33 lessonsabout 1 hour
Start here. What a cache is, why a database needs one, and where one can live.
- The Problem a Cache Solves2 min
- What a Cache Is3 min
- Where Caches Live3 min
- Reading From a Cache2 min
- Writing Through a Cache2 min
- How Caches Fail3 min
The two places a copy can sit that are faster than Redis, and harder to correct.
- Client-Side Caching2 min
- In-Process Caching2 min
How the application reads data, from cache first, or transparently.
- Cache-Aside3 min
- Read-Through3 min
- What a Hit Rate Actually Buys You2 min
- Staleness and TTLs2 min
How and when writes propagate from cache to the database.
- Write-Through2 min
- Write-Behind2 min
- Write-Around3 min
- Cache Consistency2 min
- Picking a Combination3 min
What gets removed when cache is full, and how to handle mass expiry.
- Eviction Policies2 min
- LFU: Counting Instead of Timing2 min
- FIFO, Random, and Why Nobody Picks Them2 min
- The Stampede Problem2 min
- Locks, Jitter, and Early Refresh3 min
- Hot Keys2 min
- Negative Caching3 min
In-memory data structure store powering caches, queues, leaderboards, and pub/sub.
- Why Redis Is Fast3 min
- Data Structures Beyond Strings3 min
- Persistence: RDB and AOF3 min
- Replication, Sentinel, and Cluster3 min
Cache static assets at edge servers close to users worldwide.
- How a CDN Works3 min
- Cache Keys and Invalidation3 min
- Static vs Dynamic Content2 min
- Edge Compute3 min
Finish here. Earning the cache, placing it, and saying what it breaks before you are asked.
- Caching in an Interview3 min