Troubleshooting and Optimization

An application reads product prices from Amazon RDS through an Amazon ElastiCache cache that uses lazy loading. Price updates must appear in cache reads at once, and rarely read items must not stay in the cache indefinitely. Which actions meet these requirements? (Choose two.)

Choose 2 answers

Show the answer

Correct answersB. Update the cached item whenever the application writes a new price to the databaseC. Set a time to live (TTL) on each cached item

AWhy not this: With lazy loading alone, an updated price stays stale in the cache until the item is missed and reloaded.

BWhy this is right: Write-through updates the cache at the same time as the database, so reads see the new price immediately.

CWhy this is right: A TTL removes items after a set time, so rarely read items do not remain in the cache indefinitely.

DWhy not this: noeviction keeps every item and returns errors on writes once memory is full.

EWhy not this: More memory holds more items but neither refreshes stale prices nor removes unused items.

Writing each update to the cache as well as the database (write-through) keeps cached prices current, and a TTL expires items that are no longer read. Lazy loading alone serves stale data until a miss, noeviction keeps every item and rejects writes when memory is full, and a larger node only holds more stale items.