Q63 — AWS SAA-C03 Ch.16

Question 63 of 100 | ← Chapter 16

Q1263. A company has an application that processes information from documents that users upload. When a user uploads a new document to an Amazon S3 bucket, an AWS Lambda function is invoked. The Lambda function processes information from the documents.The company discovers that the application did not process many recently uploaded documents. The company wants to ensure that the application processes each document with retries if there is an error during the first attempt to process the document.Which solution will meet these requirements?

Correct Answer: D. Configure an Amazon Simple Queue Service (Amazon SQS) queue as an event source for the Lambda function. Configure an S3 event notification on the S3 bucket to send new document upload events to the SQS queue.

Explanation

The company needs to ensure that every uploaded document is processed by the Lambda function, with retries for failed attempts. The solution must:Guarantee delivery (no lost documents).Support retries (if processing fails initially).Be scalable and cost-effective (no unnecessary complexity).Correct Solution: DD. Configure an Amazon Simple Queue Service (Amazon SQS) queue as an event source for the Lambda function. Configure an S3 event notification on the S3 bucket to send new document upload events to the SQS queue.Why Option D is CorrectSQS Provides Reliable Message Delivery & RetriesWhen an S3 document upload event triggers the Lambda function directly, if Lambda fails, the event is lost (no retry mechanism).By using SQS as an intermediary, failed processing attempts retain the message in the queue for retries. SQS automatically retries failed invocations (with exponential backoff) until the message is processed or expires (configurable maxReceiveCount).Decouples S3 from LambdaS3 event notifications can be unreliable at scale (throttling or occasional missed events). SQS acts as a buffer, ensuring no events are lost even if Lambda is busy or fails.Scalable & Cost-EffectiveSQS is serverless and auto-scaling, handling millions of messages with minimal cost. No need for Application Load Balancer (C) or AWS Batch (B), which add unnecessary complexity.Why Other Options FailOptionWhy IncorrectAAPI Gateway + Lambda requires users to send requests via API, not automatic S3 uploads.Does not solve the retry problem (if Lambda fails, the API returns an error, but the document isn't retried).Not event-driven (requires manual invocation). || B | S3 Replication + AWS Batch introduces unnecessary complexity:Replication delays (daily schedule) mean documents aren't processed promptly. AWS Batch is overkill for simple document processing (higher cost and management overhead). No built-in retry logic (Batch jobs fail silently if not monitored). | | C | Application Load Balancer (ALB) + Lambda is not designed for event processing:ALB is for HTTP traffic, not S3 event notifications.No retry mechanism (if Lambda fails, the request is lost).Higher cost (ALB pricing vs. SQS). |Implementation Steps (Option D)Create an SQS queue (Standard or FIFO, depending on order requirements). Configure S3 event notifications to send s3:ObjectCreated:* events to the SQS queue. Set up Lambda as an SQS event source (configure batch size and retry policy). Update Lambda to process messages (delete from queue only if successful).Final RecommendationBest Choice: D (SQS + S3 Event Notifications + Lambda)Guaranteed delivery (no lost documents).Automatic retries for failed processing.Scalable and cost-efficient (serverless architecture).