Skip to content
Optimal Lab

System design · interactive

Caching and eviction

Watch a small cache hit, miss and forget a key. Three moments stop and ask you to predict before the picture answers.

1 / 10

Hits

0

Hit rate

0%

AAlice
BBob
CCarol

Database

slow

“a” is read from the database. The same keys will be computed again.

Chapter 01 · The slow path

Every read hits the database

Alice, Bob and Carol keep asking for the same few keys.

With no cache, every ask goes to the database, including a key that was just read.