cloudpatterns.appClassroomKatasWhiteboardBlog
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-aside

Free with an account

Sign in to start. It’s free, and your progress follows you to any device.

  1. Users
  2. Web API
  3. Database
From step 1 — Every request goes all the way to the database.

What you'll be able to do

  1. 1Predict database reads per second from traffic and hit ratio.
  2. 2Spot stale reads after writes and choose between TTL and explicit invalidation.
  3. 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