- Newest
- Most votes
- Most comments
Hello.
I thought option B was the correct answer.
I made the decision based on the fact that the problem statement mentions scale in and scale out, and that it scales based on the number of events.
The metric "ApproximateAgeOfOldestMessage" shows the age of the oldest message in SQS.
The larger the value of this metric, the more messages are not being processed and are continuing to accumulate in the queue.
Therefore, I thought it would be possible to process messages efficiently by controlling scale-out and scale-in using this metric.
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-available-cloudwatch-metrics.html
The correct answer is:
A. Send event details to an Amazon Simple Notification Service (Amazon SNS) topic. Configure an AWS Lambda function as a subscriber to the SNS topic to process the events. Add an on-failure destination to the function. Set an Amazon Simple Queue Service (Amazon SQS) queue as the target.
Let's break down the requirements and evaluate each option:
Requirements:
- Scale in and out based on the number of events → Needs automatic, event-driven scaling.
- If a processing error occurs, the event must move into a separate queue for review → Needs error handling with failed events sent to a "review" queue (i.e., a dead-letter or failure queue).
Option A – Correct ✅
- SNS → Lambda: SNS can fan out messages to subscribers like Lambda.
- Lambda scales automatically in response to incoming events — this satisfies the scale in/out requirement.
- On-failure destinations: AWS Lambda supports on-failure destinations. You can configure a dead-letter queue (DLQ) using Amazon SQS to capture failed invocations.
- This means if the Lambda function fails to process an event, the event payload is sent to the SQS queue for review — satisfies the error handling requirement.
✅ Meets both key requirements.
Option B – ❌
- Uses SQS + EC2 Auto Scaling.
- EC2 Auto Scaling can scale based on ApproximateAgeOfOldestMessage, which is valid for scaling.
- Can configure a dead-letter queue (DLQ) for failed messages — good for error handling.
- BUT: EC2 instances are not as responsive or granular as Lambda. They take time to launch, and scaling may lag.
- Also, the requirement is for a solution that scales based on the number of events — Lambda is event-per-execution, while EC2 scales coarsely (per instance).
- While this can work, it's not optimal and not as scalable or serverless as needed.
❌ Not the best fit — less efficient and more operational overhead.
Option C – ❌
- DynamoDB Streams + Lambda:
- Lambda scales automatically — ✅
- But: DynamoDB Streams are not intended as a general event ingestion system unless the events are coming from DynamoDB updates.
- The scenario says "process events" — implies external events being ingested.
- This solution assumes events are written to a DynamoDB table, which may not be appropriate or efficient.
- Also, no built-in mechanism to handle processing failures and send to a separate queue unless you manually code it.
- While you could add error handling, it's not as straightforward or automatic as using Lambda's on-failure destinations.
❌ Misuse of DynamoDB as an event ingestion point; lacks native failure routing.
Option D – ❌
- EventBridge → EC2 via ALB.
- EC2 Auto Scaling group behind ALB — can scale, but again, not as fine-grained or fast as Lambda.
- EventBridge can retry, but if retries fail, sending to a dead-letter queue requires custom logic.
- ALB is not a valid EventBridge target — EventBridge cannot target an ALB directly.
- Valid targets include Lambda, SNS, SQS, Kinesis, EC2 (via EventBridge Pipes), Step Functions, etc., but not ALB.
- So this architecture is not feasible.
❌ Invalid architecture (ALB not a valid EventBridge target), and uses less scalable EC2.
✅ Final Answer: A
It provides:
- Automatic scaling via Lambda
- Native error handling with on-failure destination to SQS for review
This is the most scalable, serverless, and correct solution.
answered a year ago

Doesn't lambda automatically scales in and out based on the number of messages in an Amazon SQS queue when it is configured as an event source?https://aws.amazon.com/blogs/compute/understanding-how-aws-lambda-scales-when-subscribed-to-amazon-sqs-queues/
The blog you are referring to uses the SQS→Lambda configuration. Option A has a configuration of SNS → Lambda → SQS (dead letter queue). In this case you will not be scaling based on messages within SQS.
I thought it's the same rationale, I also found another post about lambda handling spike sns messages https://www.rahulpnath.com/blog/amazon-sns-lambda-trigger-dotnet/#scaling-and-lambda-concurrency