Question 1 · choose 1
An online store's web tier sends each order synchronously to an order-processing tier on EC2 instances. During sales the processing tier falls behind, requests time out, and orders are lost. The company wants every order kept until it is processed and the processing tier to scale with the amount of waiting work. What should a solutions architect do?
- APublish orders to an Amazon SNS topic, and subscribe the processing instances to it through HTTPS endpoints
- BMove the processing tier to larger instance types and raise the load balancer's idle timeout for slow requests
- CSend orders to an Amazon SQS queue, and scale the processing Auto Scaling group on the backlog per instance
- DPut the processing tier behind an Application Load Balancer with sticky sessions turned on for the web tier
Show the answer and why
APublish orders to an Amazon SNS topic, and subscribe the processing instances to it through HTTPS endpoints
Incorrect
SNS pushes each message to subscribers instead of storing work for them to pull, and its retries to an HTTPS endpoint stop after at most an hour, so a busy tier can still miss orders.
BMove the processing tier to larger instance types and raise the load balancer's idle timeout for slow requests
Incorrect
A bigger instance raises the ceiling but keeps the tiers synchronously coupled. A large enough spike still overwhelms it and loses orders, because nothing stores the work.
CSend orders to an Amazon SQS queue, and scale the processing Auto Scaling group on the backlog per instance
Correct
The queue holds each order until a consumer processes and deletes it, so neither tier has to be available at the same moment. Backlog per instance is the documented metric for scaling consumers of a queue.
DPut the processing tier behind an Application Load Balancer with sticky sessions turned on for the web tier
Incorrect
A load balancer spreads requests across healthy targets, and stickiness pins a client to one target. Neither stores requests that the targets cannot handle yet.
"Keep every order until processed" asks for a buffer between the tiers. A queue decouples them, and scaling on backlog per instance matches capacity to the waiting work.
AWS documentation
- What is Amazon Simple Queue Service? (opens in a new tab)
- Scaling policy based on Amazon SQS (opens in a new tab)
- Fanout Amazon SNS notifications to Amazon SQS queues for asynchronous processing (opens in a new tab)
- Amazon SNS message delivery retries (opens in a new tab)
- What is an Application Load Balancer? (opens in a new tab)
- Edit target group attributes for your Application Load Balancer — Sticky sessions (opens in a new tab)