Which solution will meet these requirements?
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.
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.
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.
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.
Explanations:
Writing data to an Amazon SQS queue allows for decoupling the Lambda function from the database, which can help manage the load. Configuring a reserved concurrency limit on the Lambda function ensures that it does not exceed the database’s connection limit, protecting it from crashes. This solution effectively balances the invocations against the database’s capacity.
While migrating to an Amazon Aurora Serverless DB cluster can provide scalability and manageability, it does not address the immediate issue of the existing database’s connection limit. Additionally, the process of migrating the data may introduce complexity and downtime, which is not ideal for protecting the current database from crashes.
Creating an Amazon RDS Proxy can improve database connection management and handle more concurrent requests efficiently. However, this option assumes an existing RDS database and does not specifically protect the on-premises SQL database from connection overload, which is the primary concern. The proxy cannot be used directly with an on-premises database.
Writing to an SNS topic and invoking the Lambda function to write to the database is not an effective solution as it does not address the root issue of connection limits. Provisioned concurrency set to the number of database connections does not mitigate the risk of exceeding the connection limit during high load situations, and SNS does not inherently control the flow of messages to the database in a way that would alleviate connection stress.