Northwind Retail asks for a distributed cache for 500 GB of product data. Deliver the scope, a node count, the cache path with partitioning and eviction, stampede protection, a hot-key plan, a fix for stale prices and a key mapping choice.
How interviewers level this design
- Junior: puts a cache in front of the database with a clear miss path and eviction.
- Mid-level: uses consistent hashing, invalidates on write and prevents stampedes.
- Senior: handles hot keys, node loss, replication and the cost of warming a cold cache.
Northwind Retail caches 500 GB of product data so product pages load in milliseconds. One machine cannot hold it, so the cache is split across nodes, and the split must survive change: adding a node during a sale should not make most keys miss at once, and losing a node should not send a flood of requests to the database.
You will size the cluster, choose how keys map to nodes, pick an eviction policy, protect the database from stampedes and hot keys, and fix a write path that leaves stale prices in the cache for an hour. The cache is never the source of truth; every decision assumes the data can be rebuilt from the database.
Partition keys with consistent hashing, evict sensibly and protect the database from stampedes, hot keys and stale writes.