A logistics company is designing an architecture to process batch data files containing shipment logs uploaded to Amazon S3. The processing of each batch file is a compute-intensive operation that takes approximately 20 minutes to complete. The files are uploaded sporadically throughout the day with highly unpredictable traffic spikes, including long periods of no activity. The company wants a serverless, cost-optimized solution that automatically scales based on demand and minimizes costs during idle periods. Which architecture meets these requirements most cost-effectively?
- AConfigure Amazon S3 to trigger an AWS Lambda function directly for each upload to run the processing application, writing results back to Amazon S3.
- BConfigure Amazon S3 to send event notifications to an Amazon SQS queue. Run the processing application on a fleet of Amazon EC2 instances in an Auto Scaling group with a minimum capacity of two instances, storing execution state in an Amazon DynamoDB table configured with high Provisioned Capacity mode to handle sudden peaks.
- Configure Amazon S3 to send event notifications to an Amazon Simple Queue Service (Amazon SQS) queue. Run the processing application as containerized tasks in Amazon Elastic Container Service (Amazon ECS) on AWS Fargate Spot, scaling the number of tasks dynamically based on the queue depth, and use a Gateway VPC Endpoint for Amazon S3 traffic.Cevap
- DConfigure Amazon S3 to send event notifications to an Amazon Simple Queue Service (Amazon SQS) queue. Run the processing application on AWS Fargate tasks launched in a private subnet, routing all data transfer to and from Amazon S3 through a NAT Gateway.
Cevap
Configure Amazon S3 to send event notifications to an Amazon Simple Queue Service (Amazon SQS) queue. Run the processing application as containerized tasks in Amazon Elastic Container Service (Amazon ECS) on AWS Fargate Spot, scaling the number of tasks dynamically based on the queue depth, and use a Gateway VPC Endpoint for Amazon S3 traffic.
The correct answer combines AWS Fargate Spot (which provides serverless container execution at a steep discount) with an SQS-based scaling policy that allows the environment to scale down to zero tasks when no logs are waiting to be processed. Additionally, using a Gateway VPC Endpoint for Amazon S3 ensures that the high-volume data transfer between the Fargate tasks and S3 does not incur NAT Gateway data processing charges.
Adım Adım Çözüm
Anahtar Kavram
Serverless and Automated Scaling Architectures for Cost Efficiency
Tahmini Süre:1m 30s