Question

Difficulty: HardServerless and Automated Scaling Architectures for Cost Efficiency

A media monitoring company processes video and audio news broadcasts. External feeds drop media files of varying sizes into an Amazon S3 bucket. A metadata file specifies a strict processing sequence (chronological ordering) that must be maintained for downstream sentiment analysis. The processing jobs extract transcripts using a CPU-heavy transcription engine, which takes between 1212 to 2525 minutes per file. The current system relies on a fixed fleet of Amazon EC2 instances, which results in high idle costs during periods of low activity. A solutions architect must design a serverless, automated scaling architecture that minimizes costs, scales to zero when there is no activity, and ensures the strict processing order of media files is preserved. Which architecture meets these requirements most cost-effectively?

  1. Configure an Amazon S3 event notification to trigger an AWS Lambda function that sends message metadata to an Amazon SQS FIFO queue. Deploy the transcription engine as containerized tasks in an Amazon ECS cluster using AWS Fargate Spot capacity providers. Configure an ECS service auto scaling policy based on the queue size to process the files. Store the output in Amazon Aurora Serverless v2.Answer
  2. B
    Configure Amazon S3 to directly trigger an AWS Lambda function for each uploaded media file. Have the Lambda function execute the transcription engine code within its execution environment, and write the structured output directly to an Amazon Aurora Serverless v2 database.
  3. C
    Configure an Amazon S3 event notification to trigger an AWS Lambda function that writes metadata to an Amazon SQS Standard queue. Deploy the transcription engine as containerized tasks in an Amazon ECS cluster using AWS Fargate Spot capacity providers. Scale the ECS tasks based on the number of messages in the queue, and store the output in Amazon Aurora Serverless v2.
  4. D
    Configure Amazon S3 event notifications to send events to an Amazon EventBridge event bus. Route the events to run an Amazon ECS task on AWS Fargate using standard Fargate capacity providers. Process the media files and store the resulting transcription data in an Amazon DynamoDB table configured in Provisioned Capacity mode with Auto Scaling.

Answer

Configure an Amazon S3 event notification to trigger an AWS Lambda function that sends message metadata to an Amazon SQS FIFO queue. Deploy the transcription engine as containerized tasks in an Amazon ECS cluster using AWS Fargate Spot capacity providers. Configure an ECS service auto scaling policy based on the queue size to process the files. Store the output in Amazon Aurora Serverless v2.
The correct solution utilizes Amazon SQS FIFO queues to guarantee chronological message ordering and Amazon ECS on AWS Fargate Spot for cost-effective processing of long-running, CPU-intensive transcription workloads. SQS FIFO ensures the strict sequence is preserved, while Fargate Spot scales compute capacity down to zero when the queue is empty, eliminating idle compute costs. Using Fargate Spot provides a discount of up to 70%70\% compared to standard Fargate, and avoids the 1515-minute execution timeout limit of AWS Lambda. Amazon Aurora Serverless v2 handles database scaling dynamically and cost-efficiently for spiky, unpredictable workloads, scaling down during idle periods.

Step-by-Step Solution

1
Select a message queue pattern that guarantees ordering.
Amazon SQS FIFO queue must be used to preserve chronological order, as SQS Standard and EventBridge do not guarantee strict sequence ordering.
The scenario requires maintaining the strict chronological ordering of media files for downstream sentiment analysis.
2
Determine the appropriate compute service based on task duration and cost constraints.
AWS Fargate Spot is selected over AWS Lambda and standard AWS Fargate.
The CPU-heavy task takes 1212 to 2525 minutes. AWS Lambda has a hard timeout limit of 1515 minutes, making it unsuitable. AWS Fargate Spot provides the required runtime duration at a fraction of the cost of standard Fargate tasks (up to 70%70\% savings), scaling to zero when the queue is empty.
3
Choose a cost-optimized database configuration for unpredictable, spiky workloads.
Amazon Aurora Serverless v2 is selected to store results.
Aurora Serverless v2 scales dynamically to meet workload spikes and scales down to minimum capacity during idle periods, avoiding the high cost of provisioned database resources during idle times.

Key Concept

Selecting the most cost-effective and scale-to-zero serverless compute and database options based on execution duration and workload patterns.
Rate this question