An ecommerce application exposes an API through Amazon API Gateway that invokes AWS Lambda functions. Data is stored in an Amazon RDS for PostgreSQL DB instance. During a flash sale, API calls spiked and the application slowed: CloudWatch showed many Lambda invocations, a large number of database connections, and high CPU on the DB instance. What should the solutions architect recommend to improve performance?
Choose an answer
Tap an option to check your answer.
Correct answer: Create an Amazon RDS Proxy (using the Lambda console) and update the Lambda function to connect through the proxy endpoint..
Why this is the answer
The correct option is to create an Amazon RDS Proxy and update the Lambda function to connect through it. RDS Proxy is a fully managed database proxy that makes applications more resilient to database failures and helps manage database connections more efficiently. It pools and reuses connections, reducing the overhead of establishing new connections for each Lambda invocation, which is a common cause of high CPU and connection spikes during traffic surges. Increasing Lambda memory might improve execution speed but won't directly address the database connection bottleneck. Adding ElastiCache for Redis would help with read performance for cached data but doesn't solve the underlying issue of excessive database connections for non-cached or write operations. Changing the Lambda function to reuse connections outside the handler is a good practice but requires manual code changes and might still overwhelm the database if many concurrent Lambda instances are created, as each instance would still hold its own connection. RDS Proxy handles this pooling at a much larger scale.
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