Soru

Zorluk: OrtaServerless and Automated Scaling Architectures for Cost Efficiency

A company runs a financial ledger application that processes transaction records in batches. The transaction batches are uploaded at unpredictable intervals throughout the day. To prevent account balance discrepancies, all transactions within a batch must be processed in the exact order they were received. Each processing job takes between 20 to 30 minutes to complete. The company wants to minimize costs by ensuring that compute resources are only active and incurring charges when transactions are actually being processed. Which architecture meets these requirements in the most cost-effective manner?

  1. Publish transactions to an Amazon SQS FIFO queue. Configure an Amazon ECS service running on AWS Fargate with target tracking scaling based on queue depth to run the processing containers, scaling the service down to zero tasks when the queue is empty.Cevap
  2. B
    Publish transactions to a standard Amazon SQS queue. Configure an Amazon ECS service running on AWS Fargate with target tracking scaling based on queue depth to run the processing containers, scaling the service down to zero tasks when the queue is empty.
  3. C
    Publish transactions to an Amazon SQS FIFO queue. Configure an AWS Lambda function triggered by the queue to process the transaction batches, taking advantage of Lambda's pay-per-invocation pricing.
  4. D
    Publish transactions to an Amazon SQS FIFO queue. Configure an Amazon ECS service running on AWS Fargate to process the messages, scaling down to zero when empty. Store transaction metadata in an Amazon DynamoDB table configured with provisioned capacity mode.

Cevap

Publish transactions to an Amazon SQS FIFO queue. Configure an Amazon ECS service running on AWS Fargate with target tracking scaling based on queue depth to run the processing containers, scaling the service down to zero tasks when the queue is empty.
The correct answer combines Amazon SQS FIFO queues to guarantee strict order processing with Amazon ECS on AWS Fargate. Fargate is appropriate because it has no 15-minute timeout restriction like AWS Lambda, allowing the 20 to 30-minute jobs to complete successfully. Furthermore, by configuring target tracking scaling based on queue depth, the ECS service can scale the number of tasks down to zero when the queue is empty, eliminating idle compute costs.

Adım Adım Çözüm

1
Analyze the execution runtime requirement for the processing job.
Since each processing batch takes 20 to 30 minutes, it exceeds the 15-minute maximum timeout of AWS Lambda. A containerized solution using Amazon ECS on AWS Fargate is selected instead.
To ensure that compute resources can execute continuously for more than 15 minutes without timing out.
2
Analyze the data sequencing and ordering constraints.
To guarantee strict first-in, first-out ordering of transaction processing and prevent balance discrepancies, Amazon SQS FIFO queues are chosen over standard SQS queues.
Standard SQS queues do not guarantee strict message ordering.
3
Evaluate the scaling and pricing optimization strategies.
An ECS service running on Fargate is configured to scale dynamically based on the queue depth of the SQS FIFO queue, scaling down to zero tasks when no messages are present.
Scaling to zero tasks ensures that the company pays nothing for compute when there is no workload active.

Anahtar Kavram

Combining SQS FIFO queues for strict ordering with Amazon ECS on AWS Fargate auto-scaled to zero for cost-effective long-running batch execution.
Tahmini Süre:1m 30s
Bu soruyu puanla