
Answer-first summary for fast verification
Answer: Enable RDS Proxy on the RDS DB instance.
## Explanation **Correct Answer: B - Enable RDS Proxy on the RDS DB instance** **Why this is the correct solution:** 1. **RDS Proxy is specifically designed for this scenario** - It acts as a connection pool for RDS databases, managing and reusing database connections efficiently. 2. **Addresses connection timeout issues** - During peak traffic, Lambda functions can create too many concurrent connections to the RDS database, overwhelming it. RDS Proxy pools connections and reuses them across Lambda invocations. 3. **Minimal code changes** - RDS Proxy requires minimal code changes. You just need to point your application to the RDS Proxy endpoint instead of the direct RDS endpoint. 4. **Handles unpredictable traffic** - RDS Proxy helps manage connection spikes by pooling connections and preventing database overload. 5. **Serverless-friendly** - RDS Proxy is designed to work well with serverless applications like Lambda, where functions can scale rapidly and create many short-lived connections. **Why the other options are incorrect:** - **A. Reduce the Lambda concurrency rate**: This would limit the application's ability to handle traffic and doesn't solve the underlying connection management issue. - **C. Resize the RDS DB instance class**: While this might help temporarily, it doesn't address the fundamental connection management problem and could be expensive. The issue is connection management, not necessarily instance capacity. - **D. Migrate the database to Amazon DynamoDB**: This would require significant code changes and database migration, which contradicts the requirement for "least amount of change to the code." While DynamoDB is serverless and scales well, migration is a major architectural change. **Key Benefits of RDS Proxy:** - Connection pooling and reuse - Reduced database load from connection establishment - Improved application scalability - Enhanced security with IAM authentication - Failover support for high availability - Minimal code changes required
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company hosts a serverless application on AWS. The application uses Amazon API Gateway, AWS Lambda, and an Amazon RDS for PostgreSQL database. The company notices an increase in application errors that result from database connection timeouts during times of peak traffic or unpredictable traffic. The company needs a solution that reduces the application failures with the least amount of change to the code.
What should a solutions architect do to meet these requirements?
A
Reduce the Lambda concurrency rate.
B
Enable RDS Proxy on the RDS DB instance.
C
Resize the RDS DB instance class to accept more connections.
D
Migrate the database to Amazon DynamoDB with on-demand scaling.