Question #1167
A company uses an Amazon EventBridge rule to trigger an AWS Lambda function whenever new data is available. The Lambda function processes the data and stores it in an Amazon DynamoDB table. Occasionally, the Lambda function fails due to transient errors, and the corresponding data is not processed unless the company manually reruns the event.
What should a solutions architect do to ensure all events are eventually processed?
Configure the Lambda function to use multiple Availability Zones for deployment.
Increase the memory allocation and timeout settings of the Lambda function.
Modify the EventBridge rule's retry policy to increase the number of retries and the maximum event age.
Configure an Amazon Simple Queue Service (Amazon SQS) queue as the Lambda's dead-letter queue (DLQ). Modify the Lambda function to process messages from the queue.
Explanation
Option D is correct because using an SQS DLQ captures failed events when the Lambda function's retries (or EventBridge's retries) are exhausted. By configuring the Lambda to process messages from the DLQ, events are retried until they succeed, ensuring eventual processing.
Other options are incorrect because:
- A: Lambda inherently uses multiple AZs; this doesn't resolve transient errors.
- B: Increasing memory/timeout may not fix transient errors, which are temporary issues like network glitches.
- C: While increasing retries/event age helps, it doesn't guarantee processing if errors persist beyond the retry window. A DLQ provides a persistent mechanism for reprocessing.
Key Points:
1. DLQs store failed events for later processing.
2. SQS integrates with Lambda for asynchronous retries.
3. EventBridge retries alone may not suffice for persistent transient errors.
Answer
The correct answer is: D