Learn how to use Amazon RDS Proxy to prevent an on-premises SQL database from crashing due to excessive concurrent connections from AWS Lambda function invocations, ensuring application availability.
Table of Contents
Question
A company runs a microservice as an AWS Lambda function. The microservice writes data to an on-premises SQL database that supports a limited number of concurrent connections. When the number of Lambda function invocations is too high, the database crashes and causes application downtime. The company has an AWS Direct Connect connection between the company’s VPC and the on-premises data center. The company wants to protect the database from crashes.
Which solution will meet these requirements?
A. Write the data to an Amazon Simple Queue Service (Amazon SQS) queue. Configure the Lambda function to read from the queue and write to the existing database. Set a reserved concurrency limit on the Lambda function that is less than the number of connections that the database supports.
B. Create a new Amazon Aurora Serverless DB cluster. Use AWS DataSync to migrate the data from the existing database to Aurora Serverless. Reconfigure the Lambda function to write to Aurora.
C. Create an Amazon RDS Proxy DB instance. Attach the RDS Proxy DB instance to the Amazon RDS DB instance. Reconfigure the Lambda function to write to the RDS Proxy DB instance.
D. Write the data to an Amazon Simple Notification Service (Amazon SNS) topic. Invoke the Lambda function to write to the existing database when the topic receives new messages. Configure provisioned concurrency for the Lambda function to be equal to the number of connections that the database supports.
Answer
C. Create an Amazon RDS Proxy DB instance. Attach the RDS Proxy DB instance to the Amazon RDS DB instance. Reconfigure the Lambda function to write to the RDS Proxy DB instance.
Explanation
Amazon RDS Proxy is a fully managed, highly available database proxy that allows you to pool and control database connections, improving database efficiency and security. By creating an RDS Proxy instance and attaching it to the on-premises SQL database, you can effectively manage the number of concurrent connections to the database, preventing it from crashing due to excessive connections.
Here’s how this solution works:
- Create an Amazon RDS Proxy instance and associate it with the on-premises SQL database through the AWS Direct Connect connection.
- Reconfigure the Lambda function to write data to the RDS Proxy instance instead of directly to the on-premises database.
- RDS Proxy will manage the connection pool and control the number of concurrent connections to the on-premises database, ensuring that the limit is not exceeded.
- When the Lambda function invocations are too high, RDS Proxy will queue the connections, preventing the database from crashing due to excessive load.
By implementing RDS Proxy, you can effectively protect the on-premises SQL database from crashes caused by too many concurrent connections, without having to modify the application code or implement complex queueing mechanisms.
Amazon AWS Certified Solutions Architect – Professional SAP-C02 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified Solutions Architect – Professional SAP-C02 exam and earn Amazon AWS Certified Solutions Architect – Professional SAP-C02 certification.