An application uses an Amazon Aurora PostgreSQL DB cluster with one small primary instance and three larger read replicas. The app runs in an AWS Lambda function that opens many short-lived connections to the read replicas for read-only queries. During unpredictable high-traffic periods, the application becomes unreliable and the database reports too many connections. Which change will improve the application's reliability?
Choose an answer
Tap an option to check your answer.
Correct answer: Use Amazon RDS Proxy to create a proxy for the DB cluster. Configure a read-only endpoint on the proxy. Update the Lambda function to connect to the proxy endpoint..
Why this is the answer
The correct option, using Amazon RDS Proxy, improves reliability by managing and pooling database connections. Lambda functions, being serverless and stateless, often open new connections for each invocation. This can quickly exhaust maxconnections on the database during high traffic. RDS Proxy maintains a pool of established database connections, reusing them for new Lambda invocations, which reduces the load on the database and prevents "too many connections" errors. Increasing maxconnections might temporarily alleviate the issue but doesn't solve the underlying problem of connection storms from Lambda, and it consumes more database memory. Configuring instance scaling based on DatabaseConnections is not a direct solution for connection limits, as scaling takes time and doesn't prevent connection exhaustion during rapid spikes. The Aurora Data API is for serverless applications interacting with Aurora Serverless, not directly applicable to Aurora PostgreSQL with read replicas in this scenario, and RDS Proxy doesn't configure Data API endpoints.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed