A logistics company is designing an architecture to process telemetry data from its fleet of delivery vehicles. The telemetry data contains status updates that must be processed in the exact sequence they are generated per vehicle to ensure accurate route mapping. The ingestion volume is highly irregular, peaking during daytime deliveries and dropping to zero overnight. Each processing run involves executing a route optimization simulation that takes approximately 20 minutes to complete. The company wants a highly cost-efficient, serverless, and automated scaling solution that preserves message ordering, handles the database writes dynamically, and eliminates idle compute costs. Which architecture meets these requirements?
- Ingest the telemetry data using Amazon API Gateway and write to an Amazon SQS FIFO queue. Process the queue using Amazon ECS tasks running on AWS Fargate Spot that scale dynamically based on the queue depth and scale down to zero when the queue is empty, storing the results in an Amazon DynamoDB table in On-Demand capacity mode.Cevap
- BIngest the telemetry data using Amazon API Gateway and write to an Amazon SQS Standard queue. Process the queue using Amazon ECS tasks running on AWS Fargate Spot that scale dynamically based on CPU utilization, storing the results in an Amazon DynamoDB table in On-Demand capacity mode.
- CIngest the telemetry data using Amazon API Gateway and write to an Amazon SQS FIFO queue. Process the messages using an AWS Lambda function triggered by the queue, storing the results in an Amazon DynamoDB table in On-Demand capacity mode.
- DIngest the telemetry data using Amazon API Gateway and write to an Amazon SQS FIFO queue. Process the queue using Amazon ECS tasks running on AWS Fargate Spot that scale dynamically based on the queue depth, storing the results in an Amazon DynamoDB table in Provisioned Capacity mode with Auto Scaling.
Cevap
The architecture that uses Amazon API Gateway to ingest data, an Amazon SQS FIFO queue to preserve sequence, Amazon ECS on AWS Fargate Spot to process the 20-minute simulation with auto-scaling to zero, and Amazon DynamoDB in On-Demand capacity mode to handle spiky database writes.
The correct architecture uses Amazon SQS FIFO to ensure that telemetry status updates are processed in the exact sequence they are generated per vehicle (using the vehicle ID as the Message Group ID). Since each processing run takes 20 minutes, using AWS Fargate Spot is the most cost-effective and scalable compute option, as it supports long-running processes (unlike AWS Lambda's 15-minute execution limit) and saves up to 70% compared to standard Fargate tasks. Scaling the ECS service to zero when the queue is empty eliminates idle compute costs. Finally, Amazon DynamoDB in On-Demand capacity mode is ideal for highly irregular workloads with overnight idle periods, as there is no baseline capacity charge and it scales instantly to handle peak traffic.
Adım Adım Çözüm
Anahtar Kavram
Decoupling and scaling serverless architectures cost-effectively for spiky, long-running, and ordered workloads.
Tahmini Süre:3m 0s