Question

Difficulty: MediumServerless and Automated Scaling Architectures for Cost Efficiency

A company is building a document processing platform. Users upload PDF files to an Amazon S3 bucket. A containerized application analyzes each document and extracts metadata. The upload volume is highly irregular and unpredictable, with spikes of thousands of uploads per hour followed by hours of inactivity. Each document analysis takes approximately 20 minutes to complete, and the order of processing does not matter. The extracted metadata must be stored in a database that scales automatically to handle sudden spikes. Which combination of services and capacity modes will provide the most cost-effective architecture? (Select TWO.)

  1. Run the containerized application on AWS Fargate using Spot Providers, triggered by messages in an Amazon SQS standard queue.Answer
  2. B
    Use AWS Lambda functions triggered by S3 bucket events to run the document analysis code.
  3. Store the metadata in an Amazon DynamoDB table configured with on-demand capacity mode.Answer
  4. D
    Store the metadata in an Amazon DynamoDB table configured with provisioned capacity mode and target tracking auto-scaling.
  5. E
    Run the containerized application on AWS Fargate using On-Demand Providers, triggered by messages in an Amazon SQS FIFO queue to ensure message ordering.

Answer

Run the containerized application on AWS Fargate using Spot Providers with an Amazon SQS standard queue, and store the metadata in an Amazon DynamoDB table configured with on-demand capacity mode.
Running the containerized application on AWS Fargate using Spot Providers with a standard SQS queue is cost-effective because the 20-minute execution duration exceeds the 15-minute limit of AWS Lambda. Fargate Spot offers up to a 70% discount compared to On-Demand pricing. Additionally, configuring the DynamoDB table to use on-demand capacity mode is ideal for unpredictable and spiky workloads because it charges only for actual read and write requests and scales to zero when there is no traffic, avoiding provisioned capacity costs during idle periods.

Step-by-Step Solution

1
Analyze execution time constraints for serverless compute options.
Identify that the 20-minute execution time exceeds the 15-minute limit of AWS Lambda, requiring containerized compute on AWS Fargate.
AWS Lambda will timeout if a process takes longer than 15 minutes.
2
Compare Fargate purchasing options and queue choices for cost-effectiveness.
Choose Fargate Spot Providers to run the containerized jobs at a reduced price, and pair it with a standard Amazon SQS queue since ordering is not required.
Fargate Spot is significantly cheaper than On-Demand, and SQS standard queues have lower request costs and higher throughput than FIFO queues.
3
Select the optimal database capacity mode for spiky and irregular workloads.
Select Amazon DynamoDB on-demand capacity mode to handle unpredictable traffic spikes without manual scaling delays.
On-demand capacity mode scales instantly to handle spikes and charges only for active requests, scaling down to zero cost when idle.

Key Concept

Selecting the most cost-effective serverless compute and database configurations for unpredictable, long-running batch workloads.
Rate this question