A company hosts an application on AWS Lambda functions invoked by an Amazon API Gateway API. The Lambda functions save customer data to an Amazon Aurora MySQL database. Whenever the company upgrades the database, the Lambda functions fail to establish database connections until the upgrade is complete, causing customer data to be lost for some events. A solutions architect needs to design a solution that stores customer data created during database upgrades. Which solution will meet these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Store the customer data in an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Create a new Lambda function that polls the queue and stores the customer data in the database..
Why this is the answer
Storing customer data in an Amazon SQS FIFO queue decouples the Lambda functions from the Aurora database, providing a buffer during database upgrades. When the database is unavailable, the initial Lambda functions can still successfully write data to the SQS queue. A separate Lambda function then processes messages from the queue and writes them to the database once it's back online, preventing data loss. This asynchronous pattern enhances fault tolerance. An RDS proxy helps manage database connections but doesn't solve the problem of an unavailable database. Increasing Lambda runtime and adding retries might delay failures but won't prevent data loss if the database is down for an extended period. Persisting data to Lambda local storage is ephemeral and not reliable for data persistence across invocations or during upgrades.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed