System design

Advanced

A cold cache at peak

A sports news site serves 20,000 reads per second from Redis, and the database only sees the few misses. At 15:00, in the middle of the afternoon peak, a release changes the cache key format: every key misses at once. Keep the site up while the cache warms up again.

When it is warm, the cache answers about 97 % of reads; once emptied it takes about ten minutes to fill up again. The Java application holds a thread for every call to a slow database.

What your design must achieve

  • Availability ≥ 99.95 %
  • Latency p99 < 300 ms
  • Infrastructure cost per month < 5,000 $ bonus

What you will master