SAA-C03 Question 108
Single answerAn e-commerce application serves a high volume of product catalog read requests and occasionally receives updates to product details. To improve performance and reduce latency, you are tasked with implementing a caching strategy. The application runs on AWS and uses an Amazon RDS database to store product data. Which caching strategy would BEST meet these requirements?
- A
Use Amazon ElastiCache with a write-through caching strategy to cache query results.
- B
Use Amazon CloudFront to cache database query results and serve them to users.
- C
Use Amazon ElastiCache with a lazy loading caching strategy to cache query results.
- D
Use AWS Lambda to periodically pre-fetch the top products and store them in Amazon S3.
Show answer and explanation
Correct answer: C
Explanation
A lazy loading strategy with Amazon ElastiCache is well-suited for this scenario because it caches query results only when requested, ensuring optimal performance and cost-efficiency for read-heavy workloads. This approach minimizes latency for frequently accessed data while preventing unnecessary cache updates when product details change infrequently.
- A. Incorrect.
Incorrect: A write-through caching strategy updates the cache whenever the database is updated. This strategy is not ideal for read-heavy workloads with occasional updates, as it increases overhead on write operations and may result in unnecessary cache updates.
- B. Incorrect.
Incorrect: Amazon CloudFront is designed for content delivery and caching static files like images or videos, not for caching database query results. It is not suitable for this use case.
- C. Correct.
Correct: A lazy loading caching strategy with Amazon ElastiCache is optimal for read-heavy workloads. It loads data into the cache only when requested, reducing latency for frequently accessed data without introducing unnecessary overhead for writes.
- D. Incorrect.
Incorrect: Pre-fetching product data into Amazon S3 using AWS Lambda is not a caching strategy. S3 is not a suitable caching layer for dynamic data that changes occasionally as it lacks low-latency capabilities for serving real-time queries.