Design: Distributed Caching System
Design the caching layer architecture using Redis or Memcached for a web application backend. Out of scope: database design, client application logic, and detailed security mechanisms.
Functional Requirements
FR1: Cache frequently accessed data to reduce database load
FR2: Support high read throughput with low latency (p99 < 10ms)
FR3: Handle 100,000 concurrent cache requests
FR4: Provide cache consistency with eventual consistency model
FR5: Support cache invalidation and expiration policies
FR6: Ensure high availability with 99.9% uptime
FR7: Allow horizontal scaling of cache nodes
Non-Functional Requirements
NFR1: Cache size limited to 100GB per node
NFR2: Network latency between cache nodes and clients < 5ms
NFR3: Data loss acceptable for short periods (cache is a performance layer)
NFR4: Cache miss penalty should not exceed 50ms additional latency