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 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?
- 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 and based on the SQS queue backlog, and configure Amazon DynamoDB with On-Demand capacity mode.Answer
- BPublish 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.
- CConfigure 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.
- DPublish 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.
Answer
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 and 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 minutes, AWS Fargate is used instead of AWS Lambda, which would time out. ECS Service Auto Scaling dynamically scales the Fargate tasks down to 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.
Step-by-Step Solution
Key Concept
Selecting serverless compute and database resources that scale dynamically while handling long-running task constraints and strict ordering requirements in a cost-optimized manner.
Estimated Time:2m 30s