Cache LineLesson
Cache-aside
Put a cache in front of the database so most reads never reach it — and learn the two prices you pay for it.
10 minEasyStation: Cache-asideFree with an account
Sign in to start. It’s free, and your progress follows you to any device.
- Users
- Web API
- Database
What you'll be able to do
- 1Predict database reads per second from traffic and hit ratio.
- 2Spot stale reads after writes and choose between TTL and explicit invalidation.
- 3Predict what happens to the database right after the cache is flushed or restarted.
Inside the lesson
- steps
- 8
- questions
- 4
- simulations
- 2
You guess first, then run the system and see if you were right.
Step 1 · The setup
Pixel's photos went viral. 100 requests per second now arrive, and every single one reads the same handful of hot photos from one database.
Watch where the load lands.
Steps 2–8 open with a free account