A media company is building a serverless video processing pipeline. Users upload raw video files to an Amazon S3 bucket. The transcoding process is CPU-intensive, takes between 20 to 45 minutes per video, and occurs at unpredictable intervals. The company wants to minimize compute costs, ensure the architecture scales automatically to zero when there are no uploads, and process the files in the exact order they are uploaded to maintain a chronological publishing timeline. Which architectural solution is the most cost-effective and meets these requirements?
- Configure Amazon S3 event notifications to publish upload events to an Amazon SQS FIFO queue. Use an AWS Step Functions state machine to run an Amazon ECS task on AWS Fargate using the Fargate Spot capacity provider to process the videos from the queue.Cevap
- BConfigure Amazon S3 event notifications to invoke an AWS Lambda function that downloads the video, transcodes it within its execution environment, and uploads the processed video to a destination S3 bucket.
- CConfigure Amazon S3 event notifications to publish upload events to an Amazon SQS standard queue to minimize queue costs, relying on the standard queue's default behavior to deliver the messages in strict chronological order to an Amazon ECS service running on AWS Fargate.
- DConfigure Amazon S3 event notifications to write job metadata to an Amazon DynamoDB table configured in Provisioned capacity mode with high write capacity units. Use an Amazon ECS service on AWS Fargate to continuously poll the table and process the jobs.
Cevap
Configure Amazon S3 event notifications to publish upload events to an Amazon SQS FIFO queue, and use an AWS Step Functions state machine to run an Amazon ECS task on AWS Fargate using the Fargate Spot capacity provider.
The correct solution combines Amazon SQS FIFO queues to enforce first-in, first-out ordering, with Amazon ECS on AWS Fargate using Fargate Spot capacity providers. Fargate Spot offers up to a 70% cost discount for containers and scales to zero when there are no jobs, matching the cost-efficiency goals, while bypassing AWS Lambda's 15-minute execution limit.
Adım Adım Çözüm
Anahtar Kavram
Serverless container orchestration with Fargate Spot and order preservation with SQS FIFO.