AWS Certified Developer Associate · Free Practice Question Medium
Question 21
An ecommerce website uses an AWS Lambda function and an Amazon RDS for MySQL database for an order fulfillment service. The service needs to return order confirmation immediately. During a marketing campaign that caused an increase in the number of orders, the website's operations team noticed errors for “too many connections” from Amazon RDS. However, the RDS DB cluster metrics are healthy. CPU and memory capacity are still available. What should a developer do to resolve the errors?
- A Use Amazon Simple Queue Service (Amazon SQS) FIFO queues to queue the orders. Ingest the orders into the database. Set the Lambda function's concurrency to a value that is less than the number of available database connections.
- B Use Amazon Simple Queue Service (Amazon SQS) FIFO queues to queue the orders. Ingest the orders into the database. Set the Lambda function's concurrency to a value that equals the number of available database connections.
- C Initialize the database connection outside the handler function. Increase the max_user_connections value on the parameter group of the DB cluster. Restart the DB cluster.
- D Initialize the database connection outside the handler function. Use RDS Proxy instead of connecting directly to the DB cluster.
Reveal correct answer
Correct answer: C
Explanation
The correct answer is to initialize the database connection outside the handler function and use RDS Proxy instead of connecting directly to the DB cluster. This approach helps manage and pool database connections more efficiently, reducing the likelihood of encountering "too many connections" errors during high traffic periods, such as a marketing campaign.Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
