Question

Difficulty: Very hardImproving Database and Caching Efficiency

A collaborative workspace platform operates a software-as-a-service (SaaS) application that relies on an Amazon RDS for PostgreSQL database. During peak hours of collaboration, the database experiences high CPU utilization consistently exceeding 90%90\%, resulting in application latency and timeouts.

An architectural audit reveals the following details:
* 60%60\% of the database load consists of read queries fetching static document access control lists (ACLs) and workspace folder layouts.
* 25%25\% of the database load consists of write-heavy operations that set and release short-lived document session locks. These session locks are highly dynamic but must be persisted and replicated to survive an Availability Zone outage without losing the state of active user sessions.
* 15%15\% of the load consists of transient database connections opened by short-lived AWS Fargate tasks, leading to the database frequently reaching its maximum connection limits.

Which combination of actions should the Solutions Architect take to improve database and caching efficiency, reduce primary CPU utilization, and prevent connection exhaustion? (Select THREE.)

  1. Configure Amazon ElastiCache for Redis with Multi-AZ replication and auto-failover enabled, and modify the application to store active session lock states in the cache.Answer
  2. B
    Configure Amazon ElastiCache for Memcached to store active session lock states, and configure auto-discovery to handle node failure and replication.
  3. Deploy an Amazon RDS Proxy instance between the AWS Fargate tasks and the PostgreSQL database, and configure the application to connect via the proxy.Answer
  4. Create an Amazon RDS Read Replica for the PostgreSQL database, and update the application logic to direct the read-heavy queries for static document ACLs and folder layouts to the read replica.Answer
  5. E
    Configure the application to route read-heavy queries for static document ACLs and folder layouts to the standby instance of the RDS PostgreSQL Multi-AZ deployment.
  6. F
    Set up an AWS Database Migration Service (DMS) replication instance with a Change Data Capture (CDC) task to replicate tables to a secondary database for read queries, leaving the source database configuration unchanged.

Answer

Configure Amazon ElastiCache for Redis with Multi-AZ, deploy an Amazon RDS Proxy instance, and create an Amazon RDS Read Replica to offload read-heavy queries.
The solution requires addressing three separate performance problems. First, 60% of the read load can be offloaded by using an Amazon RDS Read Replica to serve static document ACLs and folder structures. Second, the write-heavy transient session lock states can be moved to an Amazon ElastiCache for Redis cluster configured with Multi-AZ replication to ensure the session state is preserved during node failures. Third, Amazon RDS Proxy pools connections to prevent connection exhaustion from transient AWS Fargate tasks.

Step-by-Step Solution

1
Identify the read-heavy component of the database workload and offload it.
60% of the queries are read-heavy and fetch static ACLs and folder layouts. An Amazon RDS Read Replica can serve these queries, relieving CPU pressure on the primary writer node.
Offloading read traffic reduces load on the primary DB instance, which directly addresses the high CPU utilization bottleneck.
2
Address the write-heavy transient session lock states.
Session locks require write-heavy operations but must survive Availability Zone failures. Amazon ElastiCache for Redis with Multi-AZ replication provides the required persistence and sub-millisecond latencies, offloading write operations from PostgreSQL.
Caching transient but critical data with replication requirements needs a caching engine that supports durability and high availability features.
3
Mitigate connection spikes from transient application tasks.
Short-lived AWS Fargate tasks create connection churn. Deploying Amazon RDS Proxy pools and shares these connections, preventing database connection exhaustion.
RDS Proxy prevents CPU and memory exhaustion caused by creating and destroying thousands of database connections.

Key Concept

Optimizing database efficiency by offloading read traffic using replicas, caching transient but persistent data with ElastiCache for Redis, and pooling connections with RDS Proxy.
Rate this question