Use RDS Proxy to absorb Lambda connection bursts against RDS for PostgreSQL
An ecommerce company runs an application on AWS. The application has an Amazon API Gateway API that invokes an AWS Lambda function. The data is stored in an Amazon RDS for PostgreSQL DB instance. During the company’s most recent flash sale, a sudden increase in API calls negatively affected the application's performance. A solutions architect reviewed the Amazon CloudWatch metrics during that time and noticed a significant increase in Lambda invocations and database connections. The CPU utilization also was high on the DB instance. What should the solutions architect recommend to optimize the application's performance?
Community Votes
83% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
RDS Proxy sits between Lambda and the database and reuses a small pool of connections, so thousands of concurrent Lambda invocations consume only a handful of database connections, which directly relieves the connection churn and the CPU it causes.
During a flash sale the API call volume spiked, Lambda invocations and database connections surged together, and the RDS instance CPU was high. The pattern is connection storm amplification, where many short-lived Lambda executions each open their own database connection.
Adding an ElastiCache for Redis cluster. Caching frequently read data reduces some queries, but it does nothing to stop the connection storm, and the metrics show connection growth as the dominant problem rather than repeated reads of the same rows.
Community Discussion (17 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
RDS Proxy maintains a connection pool and reuses connections across Lambda invocations, so a large burst of concurrent function executions maps to a small, fixed number of database connections. Pointing the function at the proxy endpoint raises the effective concurrency the database can serve and reduces the connection setup overhead that was driving the DB CPU. The proxy can be created from the Lambda configuration console, so no infrastructure redesign is needed.Why the Other Options Are Wrong
A: Increasing Lambda memory speeds up the function but does not change the number of database connections, and relying on the code to close connections does not help during a concurrency burst. B: An ElastiCache for Redis cluster reduces repeated reads of hot data but leaves the connection storm untouched, and the metric that spiked most was connections. D: Moving connection handling outside the handler is an anti-pattern because a warm Lambda container reuses global state unpredictably across concurrent environments, and it still does not solve the underlying burst.Community Comment Notes
The community voted 75 to 1 for C, and the main doubt was whether an RDS proxy can be created from the Lambda console. Commenters confirmed it can, from the function's Configuration tab under RDS databases, and cited the AWS re:Post knowledge center article on using RDS Proxy with Lambda.Official Reference
Related Analysis
Practice All SAP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full SAP-C02 Practice Test →