
Answer-first summary for fast verification
Answer: Publish events to an Amazon Simple Queue Service (Amazon SQS) queue. Create an Amazon EC2 Auto Scaling group. Configure the Auto Scaling group to scale in and out based on the ApproximateAgeOfOldestMessage metric of the queue. Configure the application to write failed messages to a dead-letter queue.
Option B is the correct answer because it leverages Amazon SQS to handle event queuing and an Amazon EC2 Auto Scaling group to dynamically scale the processing capacity based on the specific SQS queue metric `ApproximateAgeOfOldestMessage`. Here’s the detailed breakdown: 1. **Scalability**: - Using an Amazon EC2 Auto Scaling group is a robust approach for scaling the number of processing instances. The scaling policy based on `ApproximateAgeOfOldestMessage` ensures that the number of instances adjusts according to the workload. This metric gives a reliable indication of backlog in the queue, which directly correlates to the need for more or fewer processing resources. 2. **Error Handling**: - Amazon SQS dead-letter queues (DLQs) provide a straightforward mechanism to handle processing errors. If a message fails to be processed after a specified number of attempts, it is automatically moved to the dead-letter queue. This isolation of failed messages facilitates easy review and debugging. 3. **Decoupling and Reliability**: - SQS decouples the event producers and consumers, enhancing the overall architecture’s resilience and fault tolerance. The producers (publishing events to SQS) do not need to worry about the consumers’ processing capacity, as SQS handles the load balancing and retry logic implicitly. This approach offers a highly scalable, resilient, and manageable solution for processing events and handling errors effectively, which aligns well with the best practices for building scalable and fault-tolerant applications on AWS.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A solutions architect is designing a solution to process events. The solution must have the ability to scale in and out based on the number of events that the solution receives. If a processing error occurs, the event must move into a separate queue for review. Which solution will meet these requirements?
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.
B
Publish events to an Amazon Simple Queue Service (Amazon SQS) queue. Create an Amazon EC2 Auto Scaling group. Configure the Auto Scaling group to scale in and out based on the ApproximateAgeOfOldestMessage metric of the queue. Configure the application to write failed messages to a dead-letter queue.
C
Write events to an Amazon DynamoDB table. Configure a DynamoDB stream for the table. Configure the stream to invoke an AWS Lambda function. Configure the Lambda function to process the events.
D
Publish events to an Amazon EventBndge event bus. Create and run an application on an Amazon EC2 instance with an Auto Scaling group that is behind an Application Load Balancer (ALB). Set the ALB as the event bus target. Configure the event bus to retry events. Write messages to a dead-letter queue if the application cannot process the messages.