Curriculum · Module 01, Scaling a Service
Caching and eviction
A cache is small, so something has to leave. Which policy decides, and what happens when the workload changes.
What each topic covers
- Popularity is skewed, so keeping a few keys close answers most requests.
- Four ways to decide what stays, traced on a short request sequence.
- Watch hit rate over time, then swap the popular keys mid-run and see which cache keeps up.
- Hit rate for each policy on a steady workload, then what a moved hot set does to LRU, LFU and TinyLFU.
- Compute the best possible hit rate for a Zipf workload, see how little each doubling buys, and measure the gap each policy leaves.
- A time-to-live creates a cliff. Count the queries a stampede sends, then compare coalescing, leases, stale serving and early refresh.
- Three checks on FIFO, LFU after a product launch and TinyLFU admission, plus the papers behind them.
Topics
Practise this lesson
14 interview questions on caching, with worked answers and sources.
Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms