A serverless e-commerce app uses API Gateway to invoke Java-based Lambda functions that connect to an Amazon RDS for MySQL database. During a traffic spike, API performance suffered and database connections failed. The company wants to reduce Lambda latency and support traffic bursts with minimal changes. Which solution meets the requirements with the least application modification?
Choose an answer
Tap an option to check your answer.
Correct answer: Create an RDS Proxy endpoint for the database, store DB credentials in AWS Secrets Manager, configure the necessary IAM permissions, update Lambdas to connect to the RDS Proxy endpoint, and increase provisioned concurrency for the Lambda functions..
Why this is the answer
The correct option addresses both the latency and connection failure issues with minimal application changes. RDS Proxy efficiently manages and pools database connections, preventing connection exhaustion during traffic spikes and reducing the overhead of establishing new connections for each Lambda invocation. Storing credentials in Secrets Manager and configuring IAM permissions are best practices for secure database access. Increasing provisioned concurrency ensures that a sufficient number of Lambda instances are pre-initialized and ready to process requests, reducing cold start latency. Refactoring the Lambda function to open connections outside the handler is a good practice but doesn't solve the connection pooling problem at scale and requires code changes. Increasing maxconnections on the database might temporarily alleviate connection failures but doesn't optimize connection handling or reduce Lambda latency, and rebooting the database introduces downtime. The incorrect option using "reserved concurrency" instead of "provisioned concurrency" is wrong because reserved concurrency limits the maximum number of concurrent invocations, which could exacerbate performance issues during spikes, whereas provisioned concurrency keeps instances warm to reduce latency.
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