Concept Flow - Cache stampede prevention
Client requests data
Check cache for data
Return cached
Lock acquired?
Fetch from DB
Update cache
Return data to client
When a client requests data, the system checks the cache. If missing, it tries to acquire a lock to fetch from the database and update the cache. Others wait for the cache to be updated to prevent many DB hits.
