A retail company operates a popular online store on AWS. The application's product catalog is stored in an Amazon RDS for MySQL database. During peak shopping events, the database experiences high read latency and CPU utilization near 100% due to repetitive read queries for identical product details. The product data changes occasionally, and the application must serve the most up-to-date data. The company wants to implement a high-performing caching solution to reduce the database load and minimize response time. Which solution should a solutions architect recommend to meet these requirements?
- Deploy an Amazon ElastiCache for Redis cluster. Configure the application to use a cache-aside strategy to load data into the cache on a read miss, and write data to both the database and the cache on updates.Answer
- BConfigure an Amazon CloudFront distribution in front of the application. Create a cache behavior for the API endpoints serving the product catalog and set the Minimum, Default, and Maximum TTLs to 0 to ensure the catalog data is always fresh.
- CMigrate the product catalog to an Amazon DynamoDB table. Configure the table to use Provisioned Capacity Mode with static, high read capacity units to handle the peak request rate at all times.
- DConfigure an Amazon Route 53 latency routing policy to distribute read query traffic directly to Amazon RDS Read Replicas deployed across multiple AWS Regions.
Answer
Deploy an Amazon ElastiCache for Redis cluster. Configure the application to use a cache-aside strategy to load data into the cache on a read miss, and write data to both the database and the cache on updates.
Deploying Amazon ElastiCache in front of the relational database is the standard best practice for accelerating read-heavy database queries. The cache-aside strategy ensures that frequently queried product details are stored in memory, providing sub-millisecond response times. Writing updates to the cache when the database is updated ensures that inventory changes are immediately reflected, satisfying the requirement to serve the most up-to-date data.
Step-by-Step Solution
Key Concept
Database query caching using Amazon ElastiCache to offload read traffic from Amazon RDS and reduce application latency.