
Answer-first summary for fast verification
Answer: Provision two Amazon Simple Queue Service (Amazon SQS) queues: one for order collection and another for order fulfillment. Configure the EC2 instances to poll their respective queue. Create a metric based on a backlog per instance calculation. Scale the Auto Scaling groups based on this metric.
## Explanation **Correct Answer: D** **Why Option D is correct:** 1. **Decouples order collection from fulfillment**: Using SQS queues separates the two processes, allowing them to scale independently. The order collection instances can quickly push orders to a queue without waiting for fulfillment to complete. 2. **Prevents data loss**: SQS provides durable message storage, ensuring orders are not lost during scaling events or instance failures. 3. **Optimizes resource utilization**: The "backlog per instance" metric approach allows for precise scaling based on actual work in the queue rather than just CPU utilization. This ensures instances are added only when there's actual work to be done. 4. **Handles variable processing times**: Since order fulfillment takes longer than collection, the queue-based approach allows fulfillment instances to work at their own pace while collection instances continue processing new orders. **Why other options are incorrect:** **Option A**: Setting minimum capacity based on peak workload values leads to over-provisioning and poor resource utilization during off-peak hours. It doesn't address the fundamental decoupling problem between collection and fulfillment. **Option B**: Creating additional Auto Scaling groups on demand is complex and doesn't solve the core issue of decoupling the processes. It also doesn't prevent data loss during scaling events. **Option C**: While using SQS queues is correct, scaling based on "notifications that the queues send" is vague. SQS doesn't send notifications for scaling; it provides CloudWatch metrics that can be used for scaling decisions. The "backlog per instance" metric in Option D is a more precise and effective scaling approach. **Key AWS Services Used:** - **Amazon SQS**: Provides reliable message queuing to decouple components - **Amazon CloudWatch**: Monitors queue metrics for scaling decisions - **Auto Scaling**: Dynamically adjusts capacity based on workload This solution ensures both processes can scale independently, prevents data loss, and optimizes resource utilization by scaling based on actual work backlog rather than just CPU metrics.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company offers a food delivery service that is growing rapidly. Because of the growth, the company's order processing system is experiencing scaling problems during peak traffic hours. The current architecture includes the following:
The order collection process occurs quickly, but the order fulfillment process can take longer. Data must not be lost because of a scaling event.
A solutions architect must ensure that the order collection process and the order fulfillment process can both scale properly during peak traffic hours. The solution must optimize utilization of the company's AWS resources.
Which solution meets these requirements?
A
Use Amazon CloudWatch metrics to monitor the CPU of each instance in the Auto Scaling groups. Configure each Auto Scaling group's minimum capacity according to peak workload values.
B
Use Amazon CloudWatch metrics to monitor the CPU of each instance in the Auto Scaling groups. Configure a CloudWatch alarm to invoke an Amazon Simple Notification Service (Amazon SNS) topic that creates additional Auto Scaling groups on demand.
C
Provision two Amazon Simple Queue Service (Amazon SQS) queues: one for order collection and another for order fulfillment. Configure the EC2 instances to poll their respective queue. Scale the Auto Scaling groups based on notifications that the queues send.
D
Provision two Amazon Simple Queue Service (Amazon SQS) queues: one for order collection and another for order fulfillment. Configure the EC2 instances to poll their respective queue. Create a metric based on a backlog per instance calculation. Scale the Auto Scaling groups based on this metric.