AlgoViz

Distributed caching

medium 26 min

A distributed cache spreads keys over several servers, so it can hold more and answer more than one machine.

Where it shows up

The same pattern appears across everyday software.

  • Memcached client libraries

    libketama (2007) gave Memcached clients a hash ring, after a plain remainder moved most keys whenever a server was added.

  • Redis Cluster

    Keys map to 16,384 slots. Moving slots between servers is how it grows, and clients are redirected when they ask the wrong one.

  • Facebook's mcrouter

    An open source proxy for Memcached with hashing, replicated pools and cold cache warm up, so clients stay simple.

  • Amazon Dynamo

    The paper describes servers with several points on a ring, so that load from a lost server spreads over the rest.

  • Netflix EVCache

    Writes go to more than one zone and reads stay local, so a lost zone does not empty the cache.

  • Sessions on a web farm

    Any application server can serve any user, because the session lives in the shared cache.