An application uses Amazon ElastiCache to cache database data, and the cached data must update dashboards in real time. Which caching strategy best ensures the cache contains fresh data for immediate dashboard display?
Choose an answer
Tap an option to check your answer.
Correct answer: Use a write-through cache..
Why this is the answer
A write-through cache is the best strategy here because it writes data to the cache and the database simultaneously. This ensures that the cache always contains the freshest data immediately after a write operation, which is critical for real-time dashboard updates. A read-through cache populates the cache only when data is requested and not found, which could lead to stale data being displayed initially. A write-behind cache writes data to the cache first and then asynchronously to the database, meaning there's a potential delay before the database is updated, and the cache could be ahead of the database. A lazy-loading cache (also known as cache-aside) only loads data into the cache when it's requested and not present, similar to read-through, which doesn't guarantee immediate freshness for dashboards.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed