A gaming company needs to process game session logs uploaded to an Amazon S3 bucket. The processing application runs as a containerized workload, with each log file taking 20 to 30 minutes to process. The logs must be processed in the exact order they are uploaded to maintain chronological player states in Amazon DynamoDB. The volume of uploads is highly unpredictable, with significant spikes during weekends and virtually no activity during weekdays. Which architecture is the most cost-effective and meets these requirements?
- Configure Amazon S3 to send event notifications to an Amazon SQS FIFO queue. Run the containerized application on Amazon Elastic Container Service (Amazon ECS) using AWS Fargate, scaling tasks based on the queue size, and store the state in Amazon DynamoDB configured with on-demand capacity mode.Answer
- BConfigure Amazon S3 to send event notifications to a standard Amazon SQS queue. Run the containerized application on Amazon Elastic Container Service (Amazon ECS) using AWS Fargate, scaling tasks based on the queue size, and store the state in Amazon DynamoDB configured with on-demand capacity mode.
- CConfigure Amazon S3 to trigger an AWS Lambda function directly to download and process the log files, and store the state in Amazon DynamoDB configured with on-demand capacity mode.
- DConfigure Amazon S3 to send event notifications to an Amazon SQS FIFO queue. Run the containerized application on Amazon Elastic Container Service (Amazon ECS) using AWS Fargate, scaling tasks based on the queue size, and store the state in Amazon DynamoDB configured with provisioned capacity mode.
Answer
Configure Amazon S3 to send event notifications to an Amazon SQS FIFO queue. Run the containerized application on Amazon Elastic Container Service (Amazon ECS) using AWS Fargate, scaling tasks based on the queue size, and store the state in Amazon DynamoDB configured with on-demand capacity mode.
The correct architecture uses Amazon SQS FIFO to guarantee that log files are processed in chronological order. Since the processing jobs take 20 to 30 minutes, they exceed the 15-minute execution limit of AWS Lambda, requiring containerized execution on AWS Fargate. AWS Fargate scales tasks dynamically based on queue activity to ensure cost efficiency. Finally, using Amazon DynamoDB in on-demand capacity mode is the most cost-effective option for highly unpredictable workloads with extended idle periods, as it charges only for read and write requests actually performed rather than provisioning unused capacity.
Step-by-Step Solution
Key Concept
Combining serverless and automated scaling compute (Fargate), ordered messaging (SQS FIFO), and on-demand database capacity (DynamoDB) to optimize costs for unpredictable, long-running batch workloads.
Estimated Time:2m 0s