Question

Difficulty: MediumImproving Database and Caching Efficiency

A subscription-based meal kit delivery service manages its weekly menu offerings and customer delivery preferences. During the weekly menu release window, the application experiences a significant spike in read requests as customers view the new options. The backend database is an Amazon RDS for PostgreSQL Multi-AZ DB instance. During these peak hours, the DB instance experiences high CPU utilization, leading to delayed response times. The menu data is updated once a week, but the cached database queries must be highly available and support automatic failover across multiple Availability Zones to prevent downtime. Which of the following database and caching strategies should the Solutions Architect implement to resolve the performance bottleneck while meeting the availability requirements?

  1. Deploy an Amazon ElastiCache for Redis replication group with Multi-AZ and automatic failover enabled. Configure the application to cache the menu data using a cache-aside strategy.Answer
  2. B
    Deploy an Amazon ElastiCache for Memcached cluster across multiple Availability Zones. Configure the application to cache the weekly menu data using a cache-aside strategy.
  3. C
    Configure the application to route the read traffic directly to the standby replica of the Amazon RDS for PostgreSQL Multi-AZ DB instance during peak traffic hours.
  4. D
    Enable Amazon RDS Read Replicas and configure them in a Multi-AZ deployment to serve cached requests and handle database failover.

Answer

Deploy an Amazon ElastiCache for Redis replication group with Multi-AZ and automatic failover enabled, and configure the application to cache the menu data using a cache-aside strategy.
The correct strategy is to deploy an Amazon ElastiCache for Redis replication group with Multi-AZ and automatic failover. Redis supports replication and failover features, ensuring that the cached query results remain highly available across multiple Availability Zones. Implementing a cache-aside pattern allows the application to offload the read-heavy traffic from the RDS database during peak times.

Step-by-Step Solution

1
Analyze the workload requirements and identify that the menu data is semi-static (updated weekly) and read-heavy.
Caching is identified as the optimal pattern to offload query load from the database.
Since the data changes infrequently, caching prevents repetitive query execution on the relational database.
2
Evaluate caching engines (Redis vs Memcached) against the high availability and automatic failover constraints.
Amazon ElastiCache for Redis is selected because it supports replication groups, Multi-AZ, and automatic failover.
Memcached does not support replication or automatic failover across Availability Zones.
3
Select the caching strategy (cache-aside) to interface between the application, cache, and database.
The application checks the cache first, and queries the database only on a cache miss, writing the result back to the cache.
This pattern is standard for read-heavy workloads where the application handles cache misses gracefully.

Key Concept

Selecting the appropriate in-memory caching engine (Redis vs Memcached) based on replication and high availability requirements.

Alternative Method

For applications with strict microsecond response requirements and complex query patterns, migrating to Amazon Aurora and utilizing Aurora Replicas with Auto Scaling could be a database-level scaling alternative, though an in-memory cache remains more cost-effective and efficient for static data.
Estimated Time:2m 30s
Rate this question