Contain a cache stampede without serving unsafe stale data.

Instruction: Design recovery for the supplied read paths and explain which data can be stale.

Context:

A fictional service caches public product descriptions and account suspension status in the same cache. A simultaneous expiry sends a surge to the database. Product descriptions may be five minutes stale; suspension decisions must use authoritative current state. The database is nearing its safe concurrency limit.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

I would separate the two freshness contracts. For descriptions, bounded stale serving, refresh coalescing and jittered expiry can reduce the database surge...

Related Questions