A solutions architect is designing a stateless application to run on AWS. They created an AMI and launch template for the application. Jobs must be processed in parallel, and EC2 instances should be added and removed automatically based on workload. The application must be loosely coupled and job items must be durably stored. Which solution meets these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Create an Amazon Simple Queue Service (Amazon SQS) queue to hold the jobs that need to be processed. Create an Auto Scaling group by using the launch template with the scaling policy set to add and remove EC2 instances based on the number of items in the SQS queue..
Why this is the answer
The correct solution uses Amazon SQS for durable storage of job items and loose coupling, as SQS is a message queuing service designed for this purpose. An Auto Scaling group dynamically adjusts EC2 instance capacity based on the SQS queue depth, ensuring parallel processing and automatic scaling according to workload. This scaling policy directly addresses the requirement for adding and removing instances based on the actual number of jobs awaiting processing. Incorrect options: Using Amazon SNS for job processing is unsuitable because SNS is a publish/subscribe service, not a queue for durable storage and processing by a pool of workers. Scaling based on CPU usage is a generic metric and might not accurately reflect the number of jobs needing processing. Scaling based on network usage is also a generic metric and doesn't directly correlate with the number of jobs in a queue. Scaling based on the number of messages published to an SNS topic is incorrect because SNS is for notifications, not for holding jobs for processing by a worker pool.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed