A retail company is launching a new flash-sale feature where customers submit coupon claims. The claims arrive in highly unpredictable spikes, ranging from zero to 50,000 requests per minute during the 1-hour sale event, and then drop back to zero. Each claim processing task takes 1 second. To ensure fair distribution, the claims must be processed in the exact order they are received. The company wants to minimize costs and avoid paying for idle resources. Which architecture is the most cost-effective and meets these requirements?
- ADeploy an Amazon API Gateway HTTP API that writes claims to an Amazon SQS Standard queue. Configure an AWS Lambda function to poll the queue and process the claims, writing the results to an Amazon DynamoDB table configured in on-demand capacity mode.
- Deploy an Amazon API Gateway HTTP API that writes claims to an Amazon SQS FIFO queue. Configure an AWS Lambda function to poll the queue and process the claims, writing the results to an Amazon DynamoDB table configured in on-demand capacity mode.Cevap
- CDeploy an Amazon API Gateway HTTP API that writes claims to an Amazon SQS FIFO queue. Configure an AWS Lambda function to process the claims and write the results to an Amazon DynamoDB table configured with high provisioned read/write capacity units to handle the peak traffic spikes.
- DDeploy an Amazon API Gateway HTTP API that writes claims to an Amazon SQS Standard queue. Configure an AWS Lambda function to run continuously 24/7 to poll the queue and process the claims, writing the results to an Amazon DynamoDB table configured in on-demand capacity mode.
Cevap
Deploy an Amazon API Gateway HTTP API that writes claims to an Amazon SQS FIFO queue. Configure an AWS Lambda function to poll the queue and process the claims, writing the results to an Amazon DynamoDB table configured in on-demand capacity mode.
The correct answer combines Amazon API Gateway HTTP API, Amazon SQS FIFO, AWS Lambda, and Amazon DynamoDB on-demand mode. This architecture guarantees strict first-in, first-out ordering of coupon claims, handles extreme spiky traffic automatically, and scales down to zero when the sale ends, ensuring no charges are incurred for idle resources.
Adım Adım Çözüm
Anahtar Kavram
Serverless architectures with SQS FIFO and DynamoDB On-Demand provide cost optimization by scaling to zero and billing only for resources consumed, while maintaining strict message ordering.