Front the Aurora reader endpoint with RDS Proxy and open the connection outside the Lambda handler
Short answer
ACE Use RDS Proxy against the reader endpoint, connect through the proxy, and open the connection outside the handler.
Question
Key Takeaways
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.
Common mistake: 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.
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
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-proxy.html
This link opens the official vendor documentation in a new tab.
Community Votes
84% of anonymous learners picked answer ACE. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 8 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 8
-
WhyIronMan 👍 6A, D, E For those going with A,C,E, the same link already provided here https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/ in the nodejs/javascript code you can see that database connection opening (connection.connect) and closing (connection.end) are being handled INSIDE the handler function, which is correct because you want to open connections but it is a good practice to close connections
-
dkp 👍 6Opening and closing database connections outside the Lambda handler allows for efficient reuse of connections and implements connection pooling
-
L1_ 👍 5ACE: I also agree - https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/
-
jamesf 👍 4Should be ACE Opening database connections OUTSIDE the Lambda handler allows for efficient reuse of connections and implements connection pooling
-
c3518fc 👍 4https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/
Show 3 more comments
-
GripZA 👍 3"By opening the database connection outside the event handler, the connection can be reused across multiple invocations, which reduces the overhead of establishing new connections repeatedly."
-
DanShone 👍 5I agree
-
Seoyong 👍 5perfect
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DOP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full DOP-C02 Practice Test →