Question

Difficulty: Very hardServerless and Automated Scaling Architectures for Cost Efficiency

A media company is redesigning its analytics application to optimize costs and improve scalability. The application receives clickstream data from client devices at highly unpredictable intervals throughout the day, which must be stored in a NoSQL database. Every night, a batch job runs to aggregate and analyze the daily clickstream data, taking between 3 to 4 hours to complete. Additionally, the application runs in private subnets and must frequently transfer hundreds of gigabytes of raw logs to and from an Amazon S3 bucket. Which combination of architectural decisions represents the most cost-effective and scalable solution?

  1. Set the Amazon DynamoDB table capacity mode to on-demand, execute the nightly batch job using Amazon ECS tasks running on AWS Fargate Spot, and configure an Amazon S3 Gateway VPC Endpoint in the private subnets.Answer
  2. B
    Set the Amazon DynamoDB table capacity mode to on-demand, execute the nightly batch job using AWS Lambda functions chained via Amazon SQS, and route the Amazon S3 data transfer through a NAT Gateway.
  3. C
    Set the Amazon DynamoDB table capacity mode to on-demand, execute the nightly batch job using Amazon ECS tasks running on AWS Fargate Spot, and route the Amazon S3 data transfer through a NAT Gateway.
  4. D
    Set the Amazon DynamoDB table capacity mode to provisioned capacity mode with a fixed read/write capacity, execute the nightly batch job using Amazon ECS tasks running on AWS Fargate Spot, and configure an Amazon S3 Gateway VPC Endpoint in the private subnets.

Answer

The most cost-effective and scalable solution is to set the Amazon DynamoDB table capacity mode to on-demand, run the nightly batch job using Amazon ECS tasks on AWS Fargate Spot, and configure an Amazon S3 Gateway VPC Endpoint in the private subnets.
The correct option combines Amazon DynamoDB on-demand mode (to dynamically handle spiky clickstream ingestion), AWS Fargate Spot (to cost-effectively host containerized tasks that run for several hours without paying full Fargate prices), and an Amazon S3 Gateway VPC Endpoint (to eliminate NAT Gateway processing fees for the frequent, large S3 transfers).

Step-by-Step Solution

1
Analyze NoSQL database scaling and cost requirements.
Since client clickstream traffic is highly unpredictable and spiky, Amazon DynamoDB in on-demand capacity mode is selected to automatically scale throughput and charge only for actual reads and writes, avoiding expensive over-provisioning.
To ensure maximum cost-efficiency for unpredictable workloads.
2
Evaluate compute options for the 3-4 hour nightly batch job.
AWS Lambda is ruled out due to its 15-minute timeout and high cost for long-running continuous executions. Amazon ECS tasks running on AWS Fargate Spot are selected as they support long runtimes at a heavily discounted rate.
To select a cost-optimized, containerized compute environment suitable for multi-hour processing.
3
Evaluate private data transfer to Amazon S3.
Instead of routing high volumes of S3 traffic through a NAT Gateway (which incurs per-GB data processing charges), an S3 Gateway VPC Endpoint is configured.
To enable free, private network routing between the VPC and Amazon S3.

Key Concept

Selecting cost-optimized scaling and serverless models based on execution duration, traffic predictability, and network routing costs.
Rate this question