Question

Difficulty: MediumServerless and Automated Scaling Architectures for Cost Efficiency

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?

  1. 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.Answer
  2. B
    Configure 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.
  3. C
    Configure 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.
  4. D
    Configure 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.

Answer

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.

Step-by-Step Solution

1
Analyze the execution duration and compute requirements of the transcoding process.
The process takes 20 to 45 minutes, which exceeds the 15-minute maximum limit of AWS Lambda. Therefore, Amazon ECS on AWS Fargate is selected as the serverless compute platform.
To prevent runtime timeouts while maintaining a serverless scaling model.
2
Select the most cost-effective capacity provider for the containers.
AWS Fargate Spot is selected because it offers spare capacity at up to a 70% discount compared to standard Fargate, which fits the stateless, interruptible nature of batch video transcoding.
To minimize compute costs for unpredictable workloads.
3
Determine the message queue type to satisfy the strict chronological processing requirement.
Amazon SQS FIFO is selected instead of SQS standard.
Only SQS FIFO queues guarantee first-in, first-out ordering, preventing out-of-order execution.

Key Concept

Serverless container orchestration with Fargate Spot and order preservation with SQS FIFO.
Rate this question