Design a Global Small-Image Cache
Design a cache hierarchy for globally distributed, read-heavy small-image traffic backed by one fixed database.
Problem statement
Design a system that serves small images to users around the world at hundreds of thousands of reads per second. Images are stored and updated in one fixed database. Reads must be highly performant, and a short-lived stale image after an update is acceptable.
Cover the global read path, the update path, cache hierarchy, invalidation or refresh, and failure handling without replacing the fixed database.
What to build
- A global client can read a small image by its identifier.
- The system can update an image in the fixed database.
- Cached copies converge to an updated image while allowing short-lived stale reads.
- The read path handles cache and dependency failures.
At scale
- Hundreds of thousands of small-image reads per second originate from global clients.
- One fixed database stores the authoritative image data and receives updates.
- Short-lived stale reads after an update are acceptable, but no exact staleness duration is supplied.