AWS Certified Solutions Architect - Professional / Question #1018 of 529

Question #1018

A company operates a serverless event management application on AWS. The application utilizes Amazon API Gateway to trigger AWS Lambda functions written in Java, which interact with an Amazon RDS for PostgreSQL database to process transactions.

During a high-traffic product launch, the application experienced significant API latency and database connection timeouts. The company must implement a solution to reduce Lambda latency and handle sudden traffic spikes with minimal application modifications.

Which solution addresses these requirements MOST effectively while requiring the LEAST amount of application changes?

A

Modify the Lambda functions to initialize the database connection outside the handler function. Configure provisioned concurrency for the Lambda functions to pre-initialize instances.

B

Deploy an RDS Proxy endpoint for the database. Store database credentials in AWS Secrets Manager. Configure IAM policies for RDS Proxy access. Update the Lambda functions to use the RDS Proxy endpoint. Enable provisioned concurrency for the Lambda functions.

C

Create a custom RDS parameter group to increase the max_connections value. Apply the parameter group to the RDS instance and reboot it. Adjust the Lambda functions' reserved concurrency to match the database capacity.

D

Implement an RDS Proxy endpoint for the database. Store credentials in AWS Secrets Manager. Configure IAM permissions for RDS Proxy. Update the Lambda functions to connect via RDS Proxy. Set reserved concurrency for the Lambda functions.

Explanation

Answer B is correct because:
1. RDS Proxy pools and reuses database connections, preventing connection exhaustion during high traffic, which directly addresses the database timeout issue.
2. Provisioned Concurrency pre-initializes Lambda instances, reducing cold-start latency.
3. AWS Secrets Manager securely stores credentials, aligning with best practices.
4. Minimal code changes are required—only updating the Lambda functions to use the RDS Proxy endpoint.

Other options are less effective:
- A does not address database connection limits.
- C manually scales RDS connections, which is less efficient and requires application-level tuning.
- D uses reserved concurrency, which limits scalability instead of pre-warming instances.

Key Points: Use RDS Proxy for connection pooling and Secrets Manager for credentials. Enable provisioned concurrency to reduce Lambda cold starts during traffic spikes.

Answer

The correct answer is: B