
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
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?
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.
Explanation:
Correct Answer: 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.
Why this is correct:
Decoupling and Resilience: SQS provides a reliable, durable message queue that decouples the Lambda functions from the database. During database upgrades, the Lambda functions can still write customer data to the SQS queue without needing to establish direct database connections.
Asynchronous Processing: The solution creates a separate Lambda function that polls the queue and writes data to the database. This allows for:
FIFO Queue Benefits: Using a FIFO (First-In-First-Out) queue ensures that customer data is processed in the order it was received, which is important for maintaining data consistency.
Why other options are incorrect:
A. RDS Proxy: While RDS Proxy can help with connection pooling and management, it doesn't solve the fundamental problem of database unavailability during upgrades. The proxy still needs to connect to the database, which will be unavailable during maintenance.
B. Increase Lambda runtime with retry: This approach is problematic because:
C. Lambda local storage: This is not a viable solution because:
Key Design Principles Applied: