Development with AWS Services

Hundreds of application instances cache expensive RDS report results in ElastiCache, with staleness of up to five minutes permitted. Simultaneous expiration causes database overload, especially for one popular report; which design best addresses both synchronized expiration and duplicate recomputation?

Show the answer

Correct answerB. Randomize TTLs below five minutes and coordinate per-report regeneration with a shared lock.

AWhy not this: Instance-local locks do not coordinate hundreds of instances, and identical TTLs retain synchronized expiration.

BWhy this is right: TTL jitter spreads expirations, and shared per-report coordination prevents duplicate regeneration across instances.

CWhy not this: Jitter spreads different reports' expirations but does not coordinate concurrent misses for the same report.

DWhy not this: Identical TTLs synchronize expiration, and independent regeneration multiplies database work.

TTL jitter spreads expirations, while a shared per-report lock limits concurrent regeneration across instances. Jitter alone cannot prevent many requests from recomputing the same popular report after its entry expires.