AWS Certified Solutions Architect – Professional (SAP-C02) — Question 407
A company has an application that uses an Amazon Aurora PostgreSQL DB cluster for the application's database. The DB cluster contains one small primary instance and three larger replica instances. The application runs on an AWS Lambda function. The application makes many short-lived connections to the database's replica instances to perform read-only operations.
During periods of high traffic, the application becomes unreliable and the database reports that too many connections are being established. The frequency of high-traffic periods is unpredictable.
Which solution will improve the reliability of the application?
Answer options
- A. Use Amazon RDS Proxy to create a proxy for the DB cluster. Configure a read-only endpoint for the proxy. Update the Lambda function to connect to the proxy endpoint.
- B. Increase the max_connections setting on the DB cluster's parameter group. Reboot all the instances in the DB cluster. Update the Lambda function to connect to the DB cluster endpoint.
- C. Configure instance scaling for the DB cluster to occur when the DatabaseConnections metric is close to the max connections setting. Update the Lambda function to connect to the Aurora reader endpoint.
- D. Use Amazon RDS Proxy to create a proxy for the DB cluster. Configure a read-only endpoint for the Aurora Data API on the proxy. Update the Lambda function to connect to the proxy endpoint.
Correct answer: A
Explanation
Amazon RDS Proxy pools and shares database connections, which prevents the high volume of short-lived AWS Lambda connections from overwhelming the database and causing connection limits to be exceeded. Configuring a read-only endpoint on the proxy ensures that the read-only queries are correctly routed to the replica instances without exhausting resources. Increasing the connection limit manually or scaling instances dynamically is either insufficient or too slow to handle unpredictable traffic spikes.