Question #601
An application is using an Amazon RDS for PostgreSQL Multi-AZ DB instance in the us-west-2 Region. After a failover event, the application lost connections to the database and could not reconnect until it was manually restarted. A solutions architect must ensure the application can automatically re-establish connections to the database without requiring a restart.
Which solution will meet these requirements?
Create an Amazon Aurora PostgreSQL Serverless v2 DB cluster. Migrate the RDS DB instance to the Aurora Serverless v2 cluster. Update the application's connection settings to use the Aurora reader endpoint.
Create an RDS Proxy. Configure the existing RDS endpoint as a target. Update the application's connection settings to point to the RDS Proxy endpoint.
Create a Multi-AZ Amazon Aurora PostgreSQL DB cluster. Migrate the RDS DB instance to the Aurora cluster. Configure an RDS Proxy with the Aurora cluster as the target. Update the application's connection settings to use the RDS Proxy endpoint.
Use AWS Database Migration Service (AWS DMS) to replicate the database to an Amazon DynamoDB table. Update the application to use the AWS SDK to connect to DynamoDB for all database operations.
Explanation
Answer B is correct because RDS Proxy manages database connections and automatically redirects traffic to the new primary instance during a failover. The application connects to the RDS Proxy endpoint instead of the database directly, ensuring seamless reconnection without code changes or restarts.
Other options are incorrect because:
- A: Aurora Serverless v2's reader endpoint is for read-only workloads, not failover handling.
- C: Migrating to Aurora adds unnecessary complexity; RDS Proxy alone resolves the issue.
- D: DynamoDB requires rewriting the application and changes the database type, which is not required.
Key Points:
1. RDS Proxy abstracts database endpoints and handles failovers.
2. Multi-AZ alone does not resolve application-level connection handling.
3. DNS updates after failover may not be immediately recognized by applications without connection management.
Answer
The correct answer is: B