DVA-C02 exam dumps

DVA-C02 practice question 102 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 102

Single answer

You are developing an e-commerce application that uses an Amazon ElastiCache cluster to improve the performance of frequently accessed product details. You want to implement a caching strategy that minimizes cache misses while ensuring that updates to the database are immediately reflected in the cache. Which caching strategy should you use?

  1. A

    Write-through caching

  2. B

    Read-through caching

  3. C

    Lazy loading

  4. D

    Time-to-live (TTL)

Show answer and explanation

Correct answer: A

Explanation

Write-through caching is the best strategy when you need to ensure that the cache is always updated immediately whenever the database is updated. This reduces the likelihood of cache misses and ensures that the cache remains consistent with the database, which is critical for applications requiring up-to-date data such as an e-commerce platform displaying product details.

  • A. Correct.

    Write-through caching updates the cache immediately whenever the underlying database is updated, ensuring the cache remains consistent with the database and minimizing cache misses.

  • B. Incorrect.

    Read-through caching loads data into the cache only when a cache miss occurs. This does not ensure immediate consistency between the cache and the database.

  • C. Incorrect.

    Lazy loading loads data into the cache only when it is requested and not found in the cache. While it reduces unnecessary writes to the cache, it can result in higher cache miss rates and does not immediately reflect database updates in the cache.

  • D. Incorrect.

    Time-to-live (TTL) is a mechanism to set an expiration time for cache entries. While it helps in controlling stale data, it is not a caching strategy by itself and does not ensure immediate consistency with the database.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam