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?
- 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
- BPublish 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.
- CPublish 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.
- DPublish 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
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