
Answer-first summary for fast verification
Answer: Utilize Amazon Simple Queue Service (SQS) to queue data. Configure the Lambda function to consume from the queue and update the existing database, setting a reserved concurrency limit on the Lambda function below the database's connection limit.
The correct answer is A. The on-premises SQL database has a limited number of concurrent connections, and high invocation rates of the AWS Lambda function can cause the database to crash. Option A utilizes Amazon SQS to queue the data, which allows for controlled consumption by the Lambda function without overloading the database. Setting a reserved concurrency limit lower than the database's connection limit ensures that there will be no more concurrent Lambda function invocations than the database can handle. Options B and C involve migrating to other databases, which doesn't align with the company's requirement to protect the existing database. Option D, using SNS, could potentially help but doesn't provide the same level of control over invocation rates as SQS does.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company operates a microservice using AWS Lambda that writes data to an on-premises SQL database with a limited capacity for concurrent connections. High Lambda invocation rates lead to database crashes and application downtime. The company maintains an AWS Direct Connect link between their VPC and the on-premises data center. To prevent database crashes, which solution should the company implement?
A
Utilize Amazon Simple Queue Service (SQS) to queue data. Configure the Lambda function to consume from the queue and update the existing database, setting a reserved concurrency limit on the Lambda function below the database's connection limit.
B
Deploy an Amazon Aurora Serverless DB cluster and migrate data from the current database using AWS DataSync. Modify the Lambda function to write to the Aurora Serverless cluster.
C
Establish an Amazon RDS Proxy instance and connect it to the existing Amazon RDS instance. Adjust the Lambda function to direct writes to the RDS Proxy instance.
D
Employ Amazon Simple Notification Service (SNS) to manage data writes. Set up the Lambda function to update the database upon receiving new messages via the SNS topic, with provisioned concurrency configured to match the database's connection limit.