Soru

Zorluk: OrtaServerless and Automated Scaling Architectures for Cost Efficiency

A financial services company is designing a transaction processing system. The system receives account balance update messages that must be processed in the exact sequence they are received to prevent reconciliation errors. The volume of these messages is highly unpredictable, characterized by sudden bursts of activity followed by long periods of idle time. Each message takes approximately 1515 milliseconds to process. The company requires a highly cost-effective, serverless architecture that scales automatically to handle peak loads and incurs no compute costs during idle periods.

Which solution meets these requirements?

  1. A
    Configure an Amazon SQS standard queue to receive the messages. Configure an AWS Lambda function with the queue as an event source to process the messages and write the results to an Amazon DynamoDB table configured with on-demand capacity mode.
  2. Configure an Amazon SQS FIFO queue to receive the messages. Configure an AWS Lambda function with the queue as an event source to process the messages and write the results to an Amazon DynamoDB table configured with on-demand capacity mode.Cevap
  3. C
    Configure an Amazon SQS FIFO queue to receive the messages. Deploy a fleet of Amazon EC2 instances in an Auto Scaling group to poll the queue, process the messages, and write the results to an Amazon DynamoDB table configured with provisioned capacity mode.
  4. D
    Configure an Amazon SQS FIFO queue to receive the messages. Deploy an AWS Lambda function configured with a maximum timeout of 1515 minutes that runs a continuous polling loop to retrieve and process messages from the queue, writing the results to an Amazon DynamoDB table configured with on-demand capacity mode.

Cevap

Configure an Amazon SQS FIFO queue to receive the messages, use an AWS Lambda function triggered by the queue via event source mapping to process the updates, and store the results in an Amazon DynamoDB table configured with on-demand capacity mode.
The correct solution uses an Amazon SQS FIFO queue to guarantee message ordering, an AWS Lambda function triggered by the queue to process updates dynamically with zero idle compute costs, and Amazon DynamoDB on-demand capacity mode to handle unpredictable traffic spikes cost-effectively.

Adım Adım Çözüm

1
Analyze the database and processing requirements of the scenario.
The workload is highly unpredictable with idle periods, and transaction updates must be processed in the exact sequence they are received.
This requires a queuing mechanism that guarantees first-in, first-out (FIFO) order, coupled with serverless compute and database services that scale to zero to maximize cost efficiency.
2
Evaluate the messaging queue options.
Amazon SQS FIFO queue is selected over SQS standard queue.
An SQS standard queue does not guarantee message ordering, whereas an SQS FIFO queue ensures that messages are processed sequentially, preventing reconciliation errors.
3
Evaluate the compute options for processing the messages.
AWS Lambda triggered by native SQS integration is selected over continuously running EC2 instances or Lambda with continuous polling loops.
AWS Lambda with SQS event source mapping scales compute resources dynamically in response to queue depth, executing in milliseconds, and costing nothing during idle periods. EC2 instances incur ongoing runtime costs when idle, and custom polling loops inside Lambda are highly cost-inefficient and will time out after 1515 minutes.
4
Evaluate the database scaling and capacity mode.
Amazon DynamoDB with on-demand capacity mode is selected over provisioned capacity mode.
On-demand capacity mode automatically scales read/write capacity to accommodate unpredictable spikes and charges nothing for idle capacity, whereas provisioned capacity mode requires manual configuration that leads to idle costs or resource throttling.

Anahtar Kavram

Building highly cost-effective, event-driven architectures with AWS Lambda, Amazon SQS FIFO, and Amazon DynamoDB on-demand to handle unpredictable, ordered transactional workloads while scaling to zero during idle periods.
Bu soruyu puanla