Question

Difficulty: MediumServerless and Automated Scaling Architectures for Cost Efficiency

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?

  1. A
    Deploy 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.
  2. 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.Answer
  3. C
    Deploy 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.
  4. D
    Deploy 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.

Answer

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.

Step-by-Step Solution

1
Analyze the scaling and cost requirements.
Identify that the system needs to scale to zero (no idle costs) and handle short, unpredictable bursts (from zero to 50,000 requests per minute). This points to serverless components.
Serverless architectures charge only for resource consumption, eliminating idle cost when traffic drops back to zero.
2
Evaluate the ordering requirement.
Determine that Amazon SQS FIFO (First-In-First-Out) is required to ensure claims are processed in the exact order they are received.
Standard SQS queues do not guarantee order, which violates the fair distribution requirement.
3
Select the optimal database capacity mode.
Choose Amazon DynamoDB in on-demand capacity mode.
On-demand mode scales instantly to handle peak spikes and scales down to zero when there is no traffic, preventing costs from over-provisioning.

Key Concept

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.
Rate this question