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?
- 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
- BConfigure 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.
- Store the order state in an Amazon DynamoDB table configured with on-demand capacity mode.Cevap
- DStore the order state in an Amazon DynamoDB table configured with provisioned capacity mode set to handle peak flash sale volumes.
- EDeploy 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
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.