
Ultimate access to all questions.
Answer-first summary for fast verification
Answer: Create an Amazon Simple Queue Service (Amazon SQS) queue. Send the requests to the queue. Configure the queue as an event source for Lambda.
## Explanation When documents are uploaded to an S3 bucket and trigger Lambda functions directly, there can be issues with: 1. **Concurrency limits** - Lambda has default concurrency limits that can be exceeded during traffic spikes 2. **Event loss** - If Lambda throttling occurs, S3 events can be lost 3. **No retry mechanism** - Direct S3-to-Lambda invocation doesn't have built-in retry capabilities **Why Option D is correct:** - **Amazon SQS provides a buffer** between S3 events and Lambda processing - **Messages are persisted** in the queue until successfully processed - **Built-in retries** - Lambda can retry failed messages - **Decouples producers and consumers** - S3 events are sent to the queue, Lambda processes from the queue - **Handles traffic spikes** - The queue absorbs bursts of uploads **Why other options are incorrect:** - **Option A**: Increasing timeout doesn't address the root cause of missed document processing - **Option B**: Replication and staging add complexity without solving the event processing reliability issue - **Option C**: Adding another Lambda function doesn't solve the fundamental problem of event loss during throttling **Best Practice:** Using SQS as a buffer between event sources and Lambda functions is a common pattern for ensuring reliable message processing, especially when dealing with unpredictable traffic patterns like those caused by marketing campaigns.
Author: LeetQuiz Editorial Team
No comments yet.
A company has deployed a serverless application that invokes an AWS Lambda function when new documents are uploaded to an Amazon S3 bucket. The application uses the Lambda function to process the documents. After a recent marketing campaign, the company noticed that the application did not process many of the documents.
What should a solutions architect do to improve the architecture of this application?
A
Set the Lambda function's runtime timeout value to 15 minutes.
B
Configure an S3 bucket replication policy. Stage the documents in the S3 bucket for later processing.
C
Deploy an additional Lambda function. Load balance the processing of the documents across the two Lambda functions.
D
Create an Amazon Simple Queue Service (Amazon SQS) queue. Send the requests to the queue. Configure the queue as an event source for Lambda.