AWS Certified Solutions Architect – Associate (SAA-C03) — Question 461
A company hosts a three-tier web application in the AWS Cloud. A Multi-AZAmazon RDS for MySQL server forms the database layer Amazon ElastiCache forms the cache layer. The company wants a caching strategy that adds or updates data in the cache when a customer adds an item to the database. The data in the cache must always match the data in the database.
Which solution will meet these requirements?
Answer options
- A. Implement the lazy loading caching strategy
- B. Implement the write-through caching strategy
- C. Implement the adding TTL caching strategy
- D. Implement the AWS AppConfig caching strategy
Correct answer: B
Explanation
The write-through caching strategy ensures that data is written to both the cache and the database at the same time, maintaining real-time data consistency and preventing stale data. In contrast, lazy loading only populates the cache on a cache miss, which does not guarantee immediate updates when database writes occur. Adding a TTL merely expires data over time rather than proactively updating it, and AWS AppConfig is not a database caching solution.