Question 1 · choose 1
A new order intake API will receive bursts of up to 2,000 orders per second during flash sales. The downstream fulfillment system can process at most 50 orders per second and cannot be scaled. No order may be lost, and customers must get an immediate confirmation that their order was received. Which design meets these requirements?
- AUse API Gateway throttling at 50 requests per second so that the fulfillment system never receives more than it can process
- BSend the orders to an Amazon SQS queue consumed by a Lambda function with a maximum concurrency on its event source mapping
- CPublish each order to an Amazon SNS topic that the fulfillment system subscribes to over HTTPS
- DCall the fulfillment system synchronously from a Lambda function with reserved concurrency of 2,000
Show the answer and why
AUse API Gateway throttling at 50 requests per second so that the fulfillment system never receives more than it can process
Incorrect
Throttled requests are rejected with an error, so during a burst most orders would be refused instead of being kept for later.
BSend the orders to an Amazon SQS queue consumed by a Lambda function with a maximum concurrency on its event source mapping
Correct
The queue stores every order durably and absorbs the burst, and the maximum concurrency setting of the SQS event source caps how many function instances call the fulfillment system at once.
CPublish each order to an Amazon SNS topic that the fulfillment system subscribes to over HTTPS
Incorrect
SNS pushes each message to the subscriber as it arrives and retries for a limited time, so the burst would reach the fulfillment system directly.
DCall the fulfillment system synchronously from a Lambda function with reserved concurrency of 2,000
Incorrect
Reserved concurrency of 2,000 allows 2,000 parallel calls into a system that handles 50, and synchronous calls make customers wait for fulfillment.
A queue in front of a fixed-capacity system turns a burst into a backlog; the consumer's concurrency limit sets the drain rate.
AWS documentation
- Configuring scaling behavior for SQS event source mappings (opens in a new tab)
- What is Amazon Simple Queue Service? (opens in a new tab)
- Throttle requests to your REST APIs for better throughput in API Gateway (opens in a new tab)
- Amazon SNS message delivery retries (opens in a new tab)
- Configuring reserved concurrency for a function (opens in a new tab)