Design Distributed Cache
Design Distributed Cache
Problem statement

Issues with this setup
Single server case

Cache eviction strategy - LRU


Stepping into the distributed world
Dedicated cache cluster

Co-located cache

Choose a cache host to call (naive approach)

Choose a cache host to call (consistent hashing)


Who is route these cache to the cache server? - Cache Client

Maintaining a list of cache servers
Option 1: Use configuration management tools

Option 2: Use external storage (e.g. S3)

Option 3: Configuration service (e.g. Zookeeper)

Achieving high availability
Protocol Option 1: probabilistic protocols (e.g. gossip, epidemic broadcast trees, bimodal multicast)
Protocol Option 2: consensus protocols (e.g. 2 or 3 phase commit, paxos, raft chain replication)
Master-slave(leader-follower) replication

What else is important?
Consistency
Data expiration
Local and remote cache
Security
Monitoring and logging
Cache client
Consistent hashing
Summary

PreviousCherami: Uber Engineering’s Durable and Scalable Task Queue in GoNextDesign a key-value cache to save the results of the most recent web server queries
Last updated