AWS Certified Solutions Architect – Associate (SAA-C02) — Question 456
A company hosts an application on AWS Lambda functions that are 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. The result is that customer data is not recorded for some of the event.
A solutions architect needs to design a solution that stores customer data that is created during database upgrades.
Which solution will meet these requirements?
Answer options
- A. Provision an Amazon RDS proxy to sit between the Lambda functions and the database. Configure the Lambda functions to connect to the RDS proxy.
- B. Increase the run time of the Lambda functions to the maximum. Create a retry mechanism in the code that stores the customer data in the database.
- C. Persist the customer data to Lambda local storage. Configure new Lambda functions to scan the local storage to save the customer data to the database.
- D. 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.
Correct answer: D
Explanation
Using an Amazon SQS FIFO queue decouples the ingestion layer from the database write layer, allowing customer data to be safely buffered during database upgrades. Once the database is back online, the consumer Lambda function can process the queued messages without any data loss. Other options like RDS Proxy (A) do not persist data during prolonged database downtime, Lambda timeouts (B) are limited to 15 minutes and will cause API Gateway timeouts, and Lambda local storage (C) is ephemeral and not shared across invocations.