A cache is a small, fast storage layer that keeps copies of frequently accessed data to speed up future access.
Instead of fetching data from a slow or costly source (like a database or API) every time, it is stored temporarily in a cache. This reduces load, latency, and repeated computations making systems faster and more efficient.
We use caching when we want to improve performance and reduce the need to recompute or refetch unchanged data.
You need to know
Cache Invalidation - You must decide when and how to update or remove outdated data from the cache.
Cache Hit vs Miss - A hit means the data was found in the cache; a miss means the system had to fetch it from the original source.
TTL (Time to Live) - This defines how long data stays in the cache before expiring.
Popular technologies
Redis (in-memory key-value store, super fast)
Memcached (lightweight in-memory store for small chunks of data)
CDNs (like Cloudflare) (cache static assets like images, JS, CSS close to the user)
Like posts like this?
Every week, you'll get a new system design concept, broken down like this one.
Free subscribers also get a little bonus:
🎁 The System Design Interview Preparation Cheat Sheet
If you're into visuals, paid subscribers unlock:
→ My Excalidraw system design template – so you have somewhere to start
→ My Excalidraw component library – used in the diagram of this issue
No pressure though. Your support helps me keep writing, and I appreciate it more than you know ❤️