DVA-C02 exam dumps

DVA-C02 practice question 101 of 399

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

DVA-C02 Question 101

Single answer

You are developing an e-commerce web application that uses Amazon ElastiCache to improve performance. The product catalog is stored in an Amazon RDS database, and users frequently request the same product data. You want to reduce the database load while ensuring that users always see the most up-to-date product information when they fetch product details. Which caching strategy is the most appropriate for this use case?

  1. A

    Write-through caching

  2. B

    Read-through caching

  3. C

    Lazy loading

  4. D

    Time-to-live (TTL) caching

Show answer and explanation

Correct answer: B

Explanation

Read-through caching is the best fit for this scenario because it checks the cache for requested data and fetches it from the database if it is not found, updating the cache in the process. This reduces database load and ensures users see the most up-to-date information. Other strategies like lazy loading or write-through caching do not fully meet the requirement of always serving the latest product data while minimizing database queries.

  • A. Incorrect.

    Write-through caching is not suitable in this case because it writes data to the cache when the database is updated, but the scenario involves reading frequently requested data, not writing it.

  • B. Correct.

    Read-through caching is the correct choice because it ensures that when data is requested, it is first checked in the cache, and if it's not there, it is fetched from the database and cached for subsequent requests. This reduces database load while keeping the cache updated with the latest data.

  • C. Incorrect.

    Lazy loading caches data only when it is requested for the first time, but it does not guarantee that the cache always has the latest data. This could lead to stale data being served to users, which does not meet the requirement of always showing the most up-to-date product information.

  • D. Incorrect.

    Time-to-live (TTL) caching is a mechanism to expire cached data after a specific duration, but it is not a standalone caching strategy. While TTL can complement a caching strategy, it does not address the need to ensure the cache always has the latest data.

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