DVA-C02 practice question 31 of 35
A company runs an ecommerce application on AWS. The application stores data in an Amazon Aurora database. A developer is adding a caching layer to the application. The caching strategy must ensure that the application always uses the most recent value for each data item. Which caching strategy will meet these requirements?
Full set: 598 questionsDomain Troubleshooting and Optimization
The write-through caching strategy ensures data consistency by writing data into the cache and the backing database at the same time. This approach guarantees that any data written to the database is immediately reflected in the cache. Consequently, any subsequent read from the cache will retrieve the most recent value, fulfilling the strict requirement that the application always uses the most up-to-date data. This strategy prioritizes data freshness over write latency.
A. A Time-To-Live (TTL) strategy evicts data after a set period, but it allows for a window of time where the cache can hold stale data if the database is updated before the TTL expires.
C. A lazy loading (or cache-aside) strategy only populates the cache when a read request results in a cache miss. It does not update the cache when data is written to the database, leading to stale data.
D. A read-through strategy is similar to lazy loading, where the cache is responsible for loading data from the database on a miss. It does not address how the cache is updated upon a write operation. ---
1. AWS ElastiCache User Guide
"Caching strategies": The documentation explicitly describes the write-through strategy: "The write-through strategy adds data or updates data in the cache whenever data is written to the database. This keeps the cache data from being stale." It also notes that lazy loading can result in stale data.
Source: AWS ElastiCache User Guide
Section: "In-Memory Caching" -> "Caching strategies".
2. AWS Well-Architected Framework
Performance Efficiency Pillar Whitepaper (July 2023): This paper discusses caching patterns. In the section "PER 8: How do you select your database solution?"
it describes caching as a technique to improve performance. The principles discussed align with write-through being the method to ensure data consistency between the cache and the database.
Source: AWS Well-Architected Framework
Performance Efficiency Pillar
Page 41
under "Caching".
3. AWS Blog
"Caching Best Practices": Multiple AWS blog posts detail caching patterns. They consistently describe write-through as the appropriate pattern when the primary requirement is to prevent stale data reads
as it synchronizes writes to both the cache and the primary database.
Source: AWS Architecture Blog
"Caching Patterns and Best Practices". (Note: Specific blog post titles may vary
but the content on this topic is consistent across official AWS blogs).
Keep practicing
Take the free DVA-C02 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DVA-C02 practice questions
- Question 1A company has a multi-node Windows legacy application that runs on premises. The applicat…
- Question 2A developer migrated a legacy application to an AWS Lambda function. The function uses a …
- Question 3A development learn has an Amazon API Gateway REST API that is backed by an AWS Lambda fu…
- Question 4A company is expanding the compatibility of its photo-snaring mobile app to hundreds of a…
- Question 5A company has an ecommerce application. To track product reviews, the company's developme…
- Question 6A social media company is designing a platform that allows users to upload data, which is…
