Soru

Zorluk: OrtaServerless and Automated Scaling Architectures for Cost Efficiency

A retail company is designing a serverless order processing system for its online storefront. The system must ingest customer order placement and cancellation events, processing them in the exact chronological sequence they are received to prevent processing a cancellation before an order is created. The traffic pattern is highly unpredictable, with massive traffic surges during flash sales and periods of complete idle time overnight. The company wants a highly scalable, serverless solution that minimizes baseline costs during periods of inactivity.

Which TWO configurations should a solutions architect select to meet these requirements cost-effectively?

  1. Configure an Amazon SQS FIFO queue to buffer incoming events and set it as an event source for an AWS Lambda function that processes the events.Cevap
  2. B
    Configure an Amazon SQS Standard queue to buffer incoming events and set it as an event source for an AWS Lambda function that processes the events.
  3. Store the order state in an Amazon DynamoDB table configured with on-demand capacity mode.Cevap
  4. D
    Store the order state in an Amazon DynamoDB table configured with provisioned capacity mode set to handle peak flash sale volumes.
  5. E
    Deploy a continuous polling worker application on AWS Lambda that runs constantly to query the database for new order events.

Cevap

The correct configurations are using an Amazon SQS FIFO queue with an AWS Lambda event source, and storing the order state in an Amazon DynamoDB table configured with on-demand capacity mode.
To process order events in the exact sequence they occur while minimizing costs during idle times, a combination of Amazon SQS FIFO queues and Amazon DynamoDB on-demand capacity mode is the most cost-effective solution. SQS FIFO ensures strict chronological order processing, and when combined with AWS Lambda, it triggers compute execution only when messages are present, scaling down to zero cost when idle. Storing the order state in DynamoDB using on-demand capacity mode ensures that the database scales instantly to handle flash sale traffic peaks and costs nothing when there are no read or write requests.

Adım Adım Çözüm

1
Analyze the sequence requirements for event processing.
Determine that strict order preservation is mandatory to prevent processing cancellations before orders.
Amazon SQS FIFO queues are required because Amazon SQS Standard queues do not guarantee message ordering.
2
Analyze the compute cost model for unpredictable and idle traffic.
Select an event-driven AWS Lambda compute option integrated with the queue rather than a continuous polling worker.
Event-driven Lambda functions scale to zero when there are no messages, whereas a continuous polling Lambda execution would incur excessive runtime costs.
3
Analyze the database capacity strategy for highly variable workloads.
Select Amazon DynamoDB on-demand capacity mode instead of provisioned capacity mode.
On-demand capacity mode scales dynamically with traffic and avoids the baseline costs of over-provisioned throughput during idle periods.

Anahtar Kavram

Designing event-driven serverless architectures using Amazon SQS FIFO queues, AWS Lambda, and Amazon DynamoDB on-demand capacity mode to optimize cost and performance for spiky workloads.
Bu soruyu puanla