Question #1655
A development team is designing a serverless application where user uploads to an Amazon S3 bucket trigger real-time data processing. The team has configured Amazon Simple Notification Service (Amazon SNS) to receive event notifications from S3. What should a solutions architect recommend to ensure fault-tolerant and scalable event processing using AWS Lambda?
Create an SNS subscription that processes events using AWS Fargate containers before invoking the Lambda function.
Configure an SNS subscription to forward events to Amazon Kinesis Data Firehose, then trigger Lambda to process batched records.
Create an SNS subscription that sends events to Amazon Simple Queue Service (Amazon SQS). Configure the SQS queue to trigger the Lambda function.
Set up an SNS subscription to route events to AWS Step Functions, which orchestrate the Lambda execution workflow.
Explanation
Answer C is correct because:
1. Fault Tolerance: SQS queues retain events if Lambda fails, allowing retries without data loss.
2. Decoupling: SQS separates S3 event notifications (via SNS) from Lambda processing, preventing overload.
3. Scalability: Lambda polls SQS and scales automatically with the queue depth, ensuring efficient resource use.
Why other options are incorrect:
- A: Using Fargate adds unnecessary complexity and costs; Lambda is serverless and more scalable.
- B: Kinesis Data Firehose introduces batching delays, conflicting with real-time requirements.
- D: Step Functions are for workflow orchestration, not direct event processing, adding overhead.
Key Points:
- SQS + Lambda is a standard pattern for async, fault-tolerant event processing.
- SNS can fanout to multiple subscribers (e.g., SQS, Lambda), but SQS provides durability.
- Always decouple components in serverless architectures to handle failures and scaling.
Answer
The correct answer is: C