Explain like I'm five · SRE

What is Caching?

Caching, told as a story about the memo board that answers frequent questions in advance.

what time do you close today?every guest asks the exact same question

Every guest asks the exact same question.Repeating the same answer every time slows the booth down.

back warehousechecking the back warehouse every single time takes forever

Checking the back warehouse every single time takes forever.The more there is to check, the more those round trips add up.

FAQcloses at 9pmrestroom by the gateumbrella at the boothwrite the answer on the memo board in advance, and you can show it right awayno trip to the warehouse — the board alone is enough

Write the answer on the memo board in advance, and you can show it right away.No trip to the warehouse — the board alone is enough.

Write only the frequent onesnot everything gets a spot
Fix the board when it changesthis is cache invalidation
Write an expiry dateit's called a TTL
Full board, oldest goes firstkeeps room for new answers
BOARDshows right awaywarehouse1s10sthe board is fast — the trip to the warehouse is slow

The board is fast — the trip to the warehouse is slow.The same answer takes very different amounts of time depending on where you look it up.

FAQcloses at 7pma wrong answer means everyone gets it wrongFAQcloses at 9pmeveryone rushing at once slows that moment downthe board can still go wrong — bad answers or a sudden rush

The board can still go wrong — bad answers or a sudden rush.A wrong answer gets copied to everyone, and a sudden rush slows that one moment down.

In one breath

Caching = writing frequent answers on a memo board in advance, so you can show them right away without a trip to the back warehouse every time.

A cache is a storage layer that keeps a copy of frequently used data somewhere faster to reach. When the original changes, the cache must be updated or invalidated — getting that timing right is the hardest part of caching.

When grown-ups say it

Cache
The memo board in front of the booth. It holds frequent answers written in advance.
TTL
The expiry date written on the board. Once it passes, you check again and rewrite it.
Cache invalidation
Fixing the board because the answer changed. Forget to fix it in time, and the wrong answer stays.
Cache hit / miss
Whether the board already had it (hit) or not (miss). A miss still means a trip to the warehouse.
Cache stampede
Everyone rushing the board at the same moment. That one moment is actually slower, not faster.
Cache layers
Having more than one level, like a booth board and a gate board. The closest board gets checked first.
Consistency
Whether the board and the warehouse agree. Often it's fine if they sync up a little late. → the people who keep the park open
Latency
How long a guest waits for an answer. Using the board cuts this time way down. → the four gauges on the wall
Next story
Ticket Booths Split by Number →
Want another term as a picture book? Request →