Architecture Design and Implementation Built for the Cloud

An application uses cache-aside with Amazon ElastiCache, and thousands of requests simultaneously query the database whenever one popular key expires. The application must retain expiration-based freshness and prevent these duplicate database reads. Which change best meets these requirements?

Show the answer

Correct answerA. Coalesce cache misses using a per-key refresh lock.

AWhy this is right: A per-key refresh lock allows one database fetch while concurrent requests wait for the refreshed value.

BWhy not this: Additional memory reduces capacity-driven evictions, not duplicate reads caused by an entry's expiration.

CWhy not this: Write-through population handles updates but does not coordinate concurrent misses when an unchanged entry expires.

DWhy not this: Expiration jitter spreads refreshes across different keys but does not coordinate requests for the same expired key.

A per-key refresh lock lets one request repopulate an expired entry while other requests wait and reuse the result. Randomized expiration reduces simultaneous expiration across different keys but does not prevent concurrent refreshes of one popular key.