DVA-C02 exam dumps

DVA-C02 practice question 103 of 399

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

DVA-C02 Question 103

Single answer

You are developing an e-commerce application that uses Amazon DynamoDB as the database and Amazon ElastiCache for caching frequently accessed product details. To improve performance while ensuring that the cache remains synchronized with the database, which caching strategy should you implement?

  1. A

    Write-through caching

  2. B

    Lazy loading

  3. C

    Read-through caching

  4. D

    Cache aside

Show answer and explanation

Correct answer: A

Explanation

In this scenario, the primary requirement is to ensure that the cache remains synchronized with the database to provide consistent data. Write-through caching is the best strategy for this use case as it ensures that every write operation to the database is also reflected in the cache. Other strategies, like lazy loading, read-through, or cache aside, either prioritize performance or rely on manual cache management but do not inherently ensure synchronization after writes.

  • A. Correct.

    Write-through caching ensures that every write operation to the database is immediately written to the cache as well, keeping the cache in sync with the database. This is suitable for scenarios where data consistency is critical.

  • B. Incorrect.

    Lazy loading caches the data only when it is requested and not found in the cache. While it reduces initial load on the cache, it doesn't ensure that the cache is always synchronized with the database.

  • C. Incorrect.

    Read-through caching involves fetching data directly from the cache, and if the data is not in the cache, it is fetched from the database and then written to the cache. This does not directly handle synchronization during a write operation.

  • D. Incorrect.

    Cache aside is a strategy where the application manages when to fetch and update the cache. It does not automatically synchronize the cache during database writes, which can lead to stale data in certain scenarios.

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