System Design · Case Studies

Case Study: Distributed Cache

Design, trade-offs, and alternatives for a distributed cache at scale.

01
Chapter One

Problem Statement

Problem Statement
Coming Soon
Problem Statement
This chapter covers distributed cache requirements: cache cluster size, eviction policy, hit rate target, network latency SLA.
📋 Chapter 1 — Summary
  • Summary content pending.
02
Chapter Two

Questions to Ask

Questions to Ask
Coming Soon
Questions to Ask
This chapter covers key questions: in-process vs distributed, key expiry, cache-aside vs read-through, replication needs.
📋 Chapter 2 — Summary
  • Summary content pending.
03
Chapter Three

Naive Design

Naive Design
Coming Soon
Naive Design
This chapter covers single Redis node as a cache and its failure modes (SPOF, memory limits, key hot spots).
📋 Chapter 3 — Summary
  • Summary content pending.
04
Chapter Four

Refined Design

Refined Design
Coming Soon
Refined Design
This chapter covers Redis cluster with consistent hashing, replication, and client-side request routing.
📋 Chapter 4 — Summary
  • Summary content pending.
05
Chapter Five

Alternatives

Alternatives
Coming Soon
Alternatives
This chapter covers two approaches: Redis Cluster vs Memcached with client-side sharding — trade-offs in features and ops.
📋 Chapter 5 — Summary
  • Summary content pending.
06
Chapter Six

Real Companies

Real Companies
Coming Soon
Real Companies
This chapter covers how Facebook's Memcached deployment and Twitter's Twemcache handle cache at billions of ops/day.
📋 Chapter 6 — Summary
  • Summary content pending.
07
Chapter Seven

Best Practices

Best Practices
Coming Soon
Best Practices
This chapter covers consistent hashing for minimal rehash, virtual nodes for balance, circuit breaker on cache cluster.
📋 Chapter 7 — Summary
  • Summary content pending.
08
Chapter Eight

What Could Go Wrong

What Could Go Wrong
Coming Soon
What Could Go Wrong
This chapter covers hot key problem destroying one node, cache stampede after invalidation, network split-brain.
📋 Chapter 8 — Summary
  • Summary content pending.