Question

Difficulty: MediumServerless and Automated Scaling Architectures for Cost Efficiency

A company needs to design a cost-effective, serverless architecture for a daily data import pipeline. Once a night, a partner system uploads a batch of files containing transactional logs to an Amazon S3 bucket. A processing job must fetch these files, sort and process the records in strict chronological order, and write the output files to a temporary S3 folder. Another internal analytics system reads and permanently deletes these output files within 48 hours. The daily sorting and processing job is CPU-heavy and typically runs continuously for 3 hours. Which architecture is the most cost-effective and appropriate for this workload?

  1. A
    Publish the file metadata to an Amazon SQS standard queue to trigger AWS Lambda functions, configuring the functions to process messages sequentially to preserve chronological ordering.
  2. B
    Run the processing job inside an Amazon ECS task using the AWS Fargate launch type, scheduled daily via Amazon EventBridge, and write the output files to an Amazon S3 Standard-Infrequent Access (S3 Standard-IA) bucket.
  3. Run the processing job inside an Amazon ECS task using the AWS Fargate launch type, scheduled daily via Amazon EventBridge, and store the output files in an Amazon S3 Standard bucket.Answer
  4. D
    Deploy the processing script as an AWS Lambda function triggered by Amazon S3 event notifications, configuring the function with maximum memory allocation to complete the workload.

Answer

Running the processing job inside an Amazon ECS task on AWS Fargate scheduled via Amazon EventBridge, and storing the output files in an Amazon S3 Standard bucket.
The correct option is to run the processing job inside an Amazon ECS task on AWS Fargate, scheduled daily via Amazon EventBridge, and store the output files in an Amazon S3 Standard bucket. Amazon ECS on AWS Fargate provides a serverless compute option that can run containerized tasks for several hours without execution timeouts, charging only for the resources consumed while running. Amazon S3 Standard is the most cost-effective storage class for temporary files deleted within 48 hours because it does not enforce a minimum storage duration charge.

Step-by-Step Solution

1
Analyze compute runtime requirements.
The process runs for 3 hours, which exceeds AWS Lambda's 15-minute execution limit. Amazon ECS on AWS Fargate is a serverless option that supports long-running tasks.
To select a compatible compute service without managing virtual servers.
2
Evaluate data storage lifecycle and billing rules.
The output files are deleted within 48 hours. S3 Standard has no minimum storage duration, whereas S3 Standard-IA has a 30-day minimum billing period.
To avoid storage duration charge penalties.
3
Assess queue ordering behavior.
SQS Standard queues do not guarantee order, which violates the requirement for strict chronological processing.
To ensure architectural alignment with business requirements.

Key Concept

Matching serverless compute limits and S3 storage lifecycle characteristics to optimize workload costs.
Estimated Time:1m 30s
Rate this question