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
Non-Functional Requirements
if cache miss:
acquire lock
if cache still miss:
data = fetch from DB
update cache
release lock
return cached data
What happens if the lock is not used here?Pass the test and this pattern moves unknown