
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
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.
Explanation:
Correct Answer: B - Enable RDS Proxy on the RDS DB instance
Why this is the correct solution:
RDS Proxy is specifically designed for this scenario - It acts as a connection pool for RDS databases, managing and reusing database connections efficiently.
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.
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.
Handles unpredictable traffic - RDS Proxy helps manage connection spikes by pooling connections and preventing database overload.
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: