Q27 — AWS SAA-C03 Ch.14
Question 27 of 100 | ← Chapter 14
Q1027. A solutions architect is designing the cloud architecture for a new stateless application that will be deployed on AWS. The solutions architect created an Amazon Machine Image (AMI) and launch template for the application.Based on the number of jobs that need to be processed, the processing must run in parallel while adding and removing application Amazon EC2 instances as needed. The application must be loosely coupled. The job items must be durably stored.Which solution will meet these requirements?
- A. Create an Amazon Simple Notification Service (Amazon SNS) topic to send 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 CPU usage.
- B. 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 network usage.
- C. 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. ✓
- D. Create an Amazon Simple Notification Service (Amazon SNS) topic to send 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 messages published to the SNS topic.
Correct Answer: C. 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.
Explanation
To design a cloud architecture for a new stateless application on AWS that processes jobs in parallel, with the capability to add and remove EC2 instances as needed, while ensuring jobs are durably stored and loosely coupled, the best solution is:C. 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.Explanation:\1. Amazon SQS for Job Storage: - SQS is a fully managed message queuing service that enables decoupling of components in a distributed system. It allows you to store jobs durably, ensuring that they are not lost and can be processed when an EC2 instance becomes available.\2. Parallel Processing: - By using SQS, you can have multiple EC2 instances pulling messages (jobs) from the queue. This allows for parallel processing of jobs, which is essential for handling a high number of jobs efficiently.\3. Auto Scaling Based on Queue Length: - Configuring the Auto Scaling group to scale based on the number of items in the SQS queue allows the system to dynamically adjust the number of EC2 instances according to the workload. If there are many jobs in the queue, new instances can be launched to handle the load, and if the queue is empty, instances can be terminated to save costs.Evaluation of Other Options:A. Create an Amazon Simple Notification Service (Amazon SNS) topic to send the jobs that need to be processed: - SNS is suitable for pub/sub messaging but does not provide durable storage for job items. It is not ideal for scenarios where jobs need to be queued and processed sequentially or in parallel.B. Create an Amazon SQS queue to hold the jobs that need to be processed: - While this option correctly uses SQS, setting the scaling policy based on network usage is not effective for determining workload. The number of items in the queue is a more accurate metric for scaling.D. Create an Amazon Simple Notification Service (Amazon SNS) topic to send the jobs that need to be processed: - Similar to option A, using SNS does not provide durable storage for job processing. Additionally, scaling based on the number of messages published to the SNS topic does not correspond to the actual workload.Conclusion:Option C is the most suitable solution for creating a resilient, scalable, and loosely coupled architecture for the stateless application, effectively handling job processing in parallel while ensuring durability of job items.