Question

Difficulty: HardServerless and Automated Scaling Architectures for Cost Efficiency

A financial company runs a daily audit process that analyzes transaction logs uploaded to an Amazon S3 bucket. The daily processing workload is highly variable: 95%95\% of the log files are small and take less than 22 minutes to process, while the remaining 5%5\% of the files contain aggregated transaction records and can take up to 2525 minutes to process. The audit process must scale dynamically to handle volume spikes during quarter-end reporting and minimize idle compute costs.

Which combination of actions should a solutions architect recommend to meet these requirements most cost-effectively? (Select TWO.)

  1. Trigger AWS Lambda functions from Amazon S3 Event Notifications to process the files that take less than 1515 minutes to run.Answer
  2. Submit containerized processing jobs to AWS Batch running on AWS Fargate Spot for files that take longer than 1515 minutes to run.Answer
  3. C
    Configure AWS Lambda functions with a 3030-minute execution timeout to process all files regardless of size.
  4. D
    Use an Amazon SQS standard queue to buffer and ingest events, relying on it to guarantee first-in, first-out (FIFO) ordering of the transaction files during parallel processing.
  5. E
    Deploy the compute instances in a private subnet and route all traffic to Amazon S3 through a NAT Gateway to minimize data transfer costs.

Answer

The most cost-effective solution uses AWS Lambda to process the short-running files (under 1515 minutes) and AWS Batch on AWS Fargate Spot to process the long-running files (up to 2525 minutes).
For the files that take less than 22 minutes to run, AWS Lambda provides a fully managed, serverless execution model that scales automatically with the input and charges only for execution time. For the aggregated transaction files taking up to 2525 minutes, AWS Lambda cannot be used due to its hard timeout limit of 1515 minutes. Packaging these jobs into containers and running them via AWS Batch using AWS Fargate Spot capacity providers allows the jobs to run without timeout limits while avoiding idle compute costs and achieving up to a 70%70\% discount compared to On-Demand rates.

Step-by-Step Solution

1
Analyze the execution times of the workload to determine compute boundaries.
Identify that 95%95\% of files finish in under 22 minutes (well below the 1515-minute timeout of AWS Lambda), while 5%5\% of files require up to 2525 minutes (which exceeds the limit of AWS Lambda).
This shows that a hybrid compute strategy is required because AWS Lambda cannot execute for longer than 1515 minutes.
2
Select the most cost-effective option for the short-running tasks.
Choose AWS Lambda triggered by Amazon S3 Event Notifications.
AWS Lambda is serverless, scales automatically with the files uploaded, and incurs no charges when there are no files to process.
3
Select the most cost-effective option for the long-running tasks.
Choose AWS Batch running on AWS Fargate Spot.
AWS Batch manages containerized batch workloads without administrative overhead, and Fargate Spot provides a serverless execution model with a discount of up to 70%70\% compared to On-Demand pricing, which is ideal for stateless batch jobs.

Key Concept

Using a hybrid serverless model to handle variable workloads, aligning compute choice (AWS Lambda vs. AWS Batch on Fargate Spot) with execution time limits to optimize cost and scalability.
Rate this question