Design: Cache Stampede Prevention System
Design focuses on cache layer and backend interaction to prevent stampede. Out of scope: detailed backend business logic, frontend UI design.
Functional Requirements
FR1: Prevent multiple requests from overwhelming the backend when cache expires
FR2: Serve cached data with low latency for read-heavy workloads
FR3: Ensure data consistency between cache and backend
FR4: Handle sudden spikes in traffic gracefully
FR5: Support cache expiration and refresh without blocking user requests
Non-Functional Requirements
NFR1: Support up to 50,000 concurrent users
NFR2: API response latency p99 under 150ms
NFR3: Availability target of 99.9% uptime
NFR4: Cache expiration time configurable between 1 minute to 1 hour