Front the Aurora reader endpoint with RDS Proxy and open the connection outside the Lambda handler
A DevOps engineer is building an application that uses an AWS Lambda function to query an Amazon Aurora MySQL DB cluster. The Lambda function performs only read queries. Amazon EventBridge events invoke the Lambda function. As more events invoke the Lambda function each second, the database's latency increases and the database's throughput decreases. The DevOps engineer needs to improve the performance of the application. Which combination of steps will meet these requirements? (Choose three.)
Community Votes
84% of anonymous learners picked answer ACE. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
RDS Proxy with the Aurora reader endpoint plus a bounded maximum connections percentage (A) and connecting the Lambda function to the proxy endpoint (E) together remove the connection-churn problem at the infrastructure layer. Opening the connection outside the Lambda event handler (C) is what makes reuse possible across invocations in the same execution environment. In-Lambda connection pooling (B) adds application-level pooling without eliminating per-invocation setup, and opening and closing connections inside the handler (D) guarantees a new connection per invocation, which is the current problem.
As EventBridge invokes the Lambda function more frequently, each invocation opening its own database connection exhausts connection capacity and raises latency. Amazon RDS Proxy sits in front of the Aurora reader endpoint and reuses database connections across invocations, with a maximum connections percentage bounding the load. The Lambda function connects through the proxy endpoint, and establishing the connection outside the event handler allows it to be reused across warm invocations instead of being recreated per request.
Opening and closing the database connection inside the Lambda event handler (D)—this guarantees a fresh connection on every invocation, which is precisely the behavior causing connection exhaustion; WhyIronMan cited the AWS blog showing the Node.js example opening the connection outside the handler. Implementing a connection pool inside the Lambda code (B)—application-level pooling does not reuse connections across concurrent Lambda environments and leaves more work to the application than the managed proxy already handles.
Community Discussion (8 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Amazon RDS Proxy maintains a pool of established database connections and reuses them across Lambda invocations, which directly removes the connection setup overhead that is driving up latency. Creating the proxy against the Aurora cluster reader endpoint and setting a maximum connections percentage (A) keeps the proxy from overwhelming the database, and pointing the Lambda function at the proxy endpoint (E) routes its read queries through that pool. In addition, opening the database connection outside the Lambda event handler (C) means a warm execution environment reuses its existing connection on subsequent invocations, which is what makes the reuse effective rather than per-request.Why the Other Options Are Wrong
B implements connection pooling inside the Lambda code with a maximum connection count. This shifts the burden to the application, cannot share connections across separate Lambda execution environments, and duplicates what RDS Proxy already manages more efficiently. D opens and closes the connection inside the handler, forcing a new database connection on every single invocation and reproducing the exact exhaustion problem described; the AWS blog's Node.js example deliberately opens the connection outside the handler, which WhyIronMan cited when arguing against it. A, C, and E are the correct combination.Community Comment Notes
Community voted A,C,E (84), with A,D,E a 16 percent minority. Several commenters stressed that opening the database connection outside the Lambda handler allows reuse across multiple invocations and implements pooling, which is the crux of why D is wrong, and linked the AWS blog on using RDS Proxy with Lambda.Official Reference
Related Analysis
Practice All DOP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full DOP-C02 Practice Test →