Soru

Zorluk: ZorServerless and Automated Scaling Architectures for Cost Efficiency

A logistics company processes high-volume shipment updates arriving at highly unpredictable intervals. The processing application requires strict ordering of updates per shipment ID to prevent data corruption in the database. Each processing job is CPU-heavy and takes approximately 1818 minutes to complete. The database uses Amazon DynamoDB to record updates. The company wants to implement a serverless, cost-optimized architecture that automatically scales to zero during idle periods and scales up to handle workload spikes. Which architecture should a solutions architect recommend?

  1. Publish shipment updates to an Amazon SQS FIFO queue. Run the processing application on AWS Fargate as an Amazon ECS service. Configure ECS Service Auto Scaling to scale tasks between 00 and 1010 based on the SQS queue backlog, and configure Amazon DynamoDB with On-Demand capacity mode.Cevap
  2. B
    Publish shipment updates to an Amazon SQS Standard queue. Run the processing application on AWS Fargate as an Amazon ECS service. Configure ECS Service Auto Scaling based on average CPU utilization, and configure Amazon DynamoDB with Provisioned capacity mode.
  3. C
    Configure an AWS Lambda function to process updates directly from an Amazon SQS FIFO queue event source, and configure Amazon DynamoDB with On-Demand capacity mode.
  4. D
    Publish shipment updates to an Amazon SQS FIFO queue. Run the processing application on AWS Fargate as an Amazon ECS service. Configure ECS Service Auto Scaling to scale tasks based on the SQS queue backlog, and configure Amazon DynamoDB with Provisioned capacity mode to handle unpredictable spiky traffic.

Cevap

Publish shipment updates to an Amazon SQS FIFO queue. Run the processing application on AWS Fargate as an Amazon ECS service. Configure ECS Service Auto Scaling to scale tasks between 00 and 1010 based on the SQS queue backlog, and configure Amazon DynamoDB with On-Demand capacity mode.
The correct solution satisfies all architectural and cost constraints. An Amazon SQS FIFO queue maintains strict ordering per shipment ID using message groups. Since the CPU-intensive tasks run for 1818 minutes, AWS Fargate is used instead of AWS Lambda, which would time out. ECS Service Auto Scaling dynamically scales the Fargate tasks down to 00 when the queue is empty to eliminate idle compute costs. Using Amazon DynamoDB in On-Demand capacity mode is optimal because the workload intervals are unpredictable, meaning the company only pays for active database reads and writes with zero base cost when idle.

Adım Adım Çözüm

1
Analyze execution duration constraints against compute options.
Since each processing job takes approximately 1818 minutes, AWS Lambda is ruled out due to its strict 1515-minute maximum execution timeout. AWS Fargate (ECS) is the appropriate serverless compute choice as it does not have this timeout constraint.
Ensures that processing completes successfully without timing out.
2
Determine ordering and scalability requirements for ingestion.
Strict ordering per shipment ID requires an Amazon SQS FIFO queue, where the shipment ID is used as the message group ID.
Guarantees sequential processing per shipment to avoid database corruption while allowing scaling across multiple shipment IDs.
3
Select database capacity mode for unpredictable workload intervals.
Configure Amazon DynamoDB with On-Demand capacity mode rather than Provisioned capacity mode.
Minimizes cost by charging only for actual read/write requests, scaling to zero when there are no updates, and automatically scaling to handle sudden spikes.
4
Design cost-efficient auto scaling for compute resources.
Configure ECS Service Auto Scaling based on SQS queue backlog (using queue size metrics) to scale tasks down to 00 when idle.
Eliminates idle compute costs during periods of no incoming updates.

Anahtar Kavram

Selecting serverless compute and database resources that scale dynamically while handling long-running task constraints and strict ordering requirements in a cost-optimized manner.
Tahmini Süre:2m 30s
Bu soruyu puanla