← All Problems
HardInfrastructure45 min
Design a Distributed Cache
Design a distributed caching system like Memcached or Redis that provides low-latency data access across a cluster.
AmazonGoogleMetaNetflix
Functional Requirements
- Sub-millisecond read/write latency
- Horizontal scaling: add nodes to increase capacity
- High availability: no single point of failure
- Support TTL-based expiration
- Handle cache invalidation and consistency
Steps (0/6)
Step 1: Clarify Requirements
What data types? (strings, hashes, lists, sorted sets) What's the expected data size? (~1TB total cache). Expected throughput? (1M ops/sec). Read/write ratio? (80:20). Consistency requirements? (eventual consistency OK for most use cases).
Key Points
- Sub-millisecond latency for both reads and writes
- ~1TB total cache across cluster
- ~1M operations/second
- Eventual consistency is acceptable
1 / 6