Soru

Zorluk: OrtaHigh-Performing Database Solutions

An e-commerce application uses an Amazon RDS for MySQL Multi-AZ DB instance. During flash sales, CPU utilization on the database spikes to 100%100\% due to a massive influx of read queries for product catalog details, causing application timeouts. The catalog data is updated only once per day. Which architecture should a solutions architect recommend to resolve this performance bottleneck with the lowest latency?

  1. A
    Migrate the product catalog to an Amazon DynamoDB table using a partition key based on a monotonically increasing timestamp of the product upload to ensure sequential read performance.
  2. B
    Configure RDS Read Replicas in the primary Availability Zone and configure the application to use the replica endpoints as the primary target for write traffic and disaster recovery failover during peak periods.
  3. Deploy an Amazon ElastiCache for Redis cluster in front of the RDS DB instance to cache product catalog queries, and configure the application to check the cache before querying the database.Cevap
  4. D
    Migrate the product catalog to an Amazon DynamoDB table configured with provisioned capacity mode to automatically scale and absorb the highly unpredictable and sudden spikes in read traffic.

Cevap

Deploying an Amazon ElastiCache for Redis cluster in front of the RDS DB instance to cache product catalog queries.
Caching the static product catalog in Amazon ElastiCache for Redis offloads the read traffic from the database, delivering microsecond response times and lowering CPU utilization to resolve the bottleneck.

Adım Adım Çözüm

1
Analyze the workload characteristics and database bottleneck.
The workload is read-heavy on static catalog data that changes infrequently, causing high CPU usage (100%100\%) on the RDS database.
Understanding the query pattern helps identify whether caching or database scaling is the most appropriate remedy.
2
Select a caching strategy to offload read queries.
Amazon ElastiCache for Redis is chosen to store database query results for the product catalog.
Caching static, read-intensive data in memory provides sub-millisecond response times and prevents the queries from reaching the database.
3
Configure the application to utilize the cache.
The application code is modified to check the ElastiCache cluster first. If the data is present (cache hit), it is returned. If not (cache miss), the RDS database is queried and the cache is updated.
This implementation successfully bypasses the database for subsequent read requests, resolving the CPU bottleneck.

Anahtar Kavram

Database Caching with Amazon ElastiCache
Tahmini Süre:1m 30s
Bu soruyu puanla