Caching layers in system design
Where caches live in a large system and what each layer is good for: browser, CDN, reverse proxy, application in-process, distributed caches like Redis, and the database's own caches, with hit rates, consistency, invalidation across layers, stampedes, hot keys, and how to discuss caching in interviews.
CodexBash, , 6 min read
"Add a cache" is the most common answer to a performance problem in system design, and also one of the most dangerous if done carelessly. In a real system there is not one cache but a stack of them, from the user's browser to the database's memory, and each layer has different strengths, costs and ways of serving stale data. Our article on caching strategies covered patterns such as cache-aside and write-through. This one zooms out to the layers: where caches sit, what each should hold, and how they interact.
Sign in to read the rest
The whole 6 minute article is free with an account, along with every problem, lesson and tutorial. No card.