Question

Difficulty: Very hardImproving Database and Caching Efficiency

A logistics enterprise operates a fleet-tracking portal backed by an Amazon RDS for PostgreSQL Multi-AZ DB instance. The database stores real-time delivery route details, driver availability, and active shipment states. During shift changes, the database experiences CPU utilization spikes up to 98%98\% and application connection timeouts due to a surge in read queries from dispatchers querying driver status. A solutions architect must design a caching layer to offload these read-intensive queries. The caching solution must support multi-AZ replication to ensure high availability, automatic failover without application changes, and the capability to restore cached routing structures from disk in the event of a cache node restart. Additionally, the application requires sub-key eviction policies to purge specific route legs when driver status changes. Which configuration meets these requirements with the lowest operational complexity?

  1. Deploy an Amazon ElastiCache for Redis cluster with Multi-AZ enabled and automatic failover. Configure the application to use a Redis hash structure for route details, allowing the update and eviction of individual fields, and enable Redis replication groups.Answer
  2. B
    Deploy an Amazon ElastiCache for Memcached cluster with nodes distributed across multiple Availability Zones. Configure the application to serialize route legs as JSON strings, and implement a custom background script to periodically export cached keys to Amazon S3 to provide persistence.
  3. C
    Enable read routing on the secondary standby instance of the existing Amazon RDS for PostgreSQL Multi-AZ deployment, and update the application configuration to direct all read queries for driver status and active delivery states to this secondary instance.
  4. D
    Deploy an Amazon RDS Proxy instance in front of the PostgreSQL database, and configure a single-node Amazon ElastiCache for Redis instance with Append Only File (AOF) enabled, relying on the RDS Proxy to queue write operations during Redis cache failover events.

Answer

Deploy an Amazon ElastiCache for Redis cluster with Multi-AZ enabled and automatic failover, using a Redis hash structure for route details.
The correct answer is to deploy an Amazon ElastiCache for Redis cluster with Multi-AZ and automatic failover. Redis supports the required features, including multi-AZ replication, persistence via Append Only File (AOF) or daily backups, and complex data structures (like hashes) which enable sub-key eviction policies.

Step-by-Step Solution

1
Analyze the technical requirements of the caching layer.
The cache must support multi-AZ replication, automatic failover, persistence (restore from disk on restart), and sub-key eviction (data structures).
This determines which caching engine (Redis vs Memcached) is appropriate.
2
Compare ElastiCache Redis and Memcached against the requirements.
Memcached does not support replication, failover, persistence, or sub-key eviction/hashes. Redis supports replication, Multi-AZ failover, persistence (AOF/RDB), and hashes.
This rules out Memcached-based solutions.
3
Evaluate the database-level alternative of reading from the standby instance.
Amazon RDS for PostgreSQL Multi-AZ standby instances are passive and cannot serve read traffic.
This rules out routing reads to the RDS standby instance.
4
Select the correct ElastiCache configuration that meets the requirements with minimal operational complexity.
An ElastiCache for Redis cluster with Multi-AZ and replication groups handles failover automatically, while native Redis hashes satisfy the sub-key eviction requirement.
This provides the optimal, highly available, and performant caching design.

Key Concept

Selecting the correct caching engine (Redis vs Memcached) and configuration based on requirements for replication, persistence, and complex data structures.
Rate this question