Caching β Part 3: Invalidation, Failure Modes & Consistency
maang.io System Design Series
What is this?
The desk drawer has served us well β but here's the dark side nobody warns you about on day one. The whole point of the drawer was to avoid the trip to the supply closet. But what happens when the thing in the closet changes and your drawer copy is now wrong? You confidently hand someone the old version. What happens when a thousand people ask for something that isn't in the drawer at the same instant, and all thousand stampede toward the closet at once, jamming the hallway? What happens when half your drawers expire on the very same tick?
This part is about everything that goes wrong because you have a cache. A cache doesn't just add speed β it adds an entire new class of failure modes, and handling them is exactly what separates someone who's used a cache from someone who's operated one in production.
The one-line idea: a cache is a second copy of the truth, and the moment you have two copies, you've signed up for the hardest problems in the field β keeping them in sync, and surviving the storm when the copy is missing.
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson