Labs โ€บ distributed cache0 / 11

Step 1 of 11 ยท Intro

Design a distributed cache

Shard it, protect the database from stampedes and survive a cold start.

How it works

  • โ€บReads check the cache first (cache-aside); on a miss the application loads from the database and refills.
  • โ€บKeys are spread over cache nodes by hashing.
  • โ€บEntries expire by TTL and are evicted when memory fills.

What you'll build

  1. The API and entry format
  2. A first cache and a sharded, layered cache tier
  3. A breaker that shields the database on a cold start
  4. A design that survives a lost cache node
  5. The reasoning: stampedes, hot keys and consistent hashing