Skip to content

Design a Distributed Cache (Memcache), stage 8 of 9: break it

A cluster with an empty cache

Other clusters in the region have warm caches with roughly the same data.

System so far· 7 parts
1234567CLIENTUsersSERVICEWeb serversSERVICEmcrouterCACHEmemcached poolCACHEGutter poolDATABASEMySQLWORKERInvalidationdaemon

Select a component to see what it is responsible for and which state it owns.

  1. 1Users → Web servers: Page request
  2. 2Web servers → mcrouter: get / multiget, delete
  3. 3mcrouter → memcached pool: Keys by consistent hash
  4. 4Web servers → MySQL: Query on miss; writes
  5. 5MySQL → Invalidation daemon: Committed deletes
  6. 6Invalidation daemon → mcrouter: Batched deletes
  7. 7mcrouter → Gutter pool: On server failure
  • Request / response
  • Bulk data
  • Asynchronous

What you need to know

0 of 2 checks done
  1. Work it out

    A cluster serves 2,000,000 reads a second. Warm, its hit rate is 99%. Cold, it's about 5%. About how many database reads a second does it send when cold?
    per second