A financial brokerage platform processes a continuous, steady stream of stock market trade executions to update user portfolio balances. The system operates 24/7, handling a high and constant volume of transactions. The updates for each individual user portfolio must be processed in the exact sequence the trades occurred. The current architecture uses an AWS Lambda function triggered by an Amazon SQS standard queue to process the trade records. This configuration is experiencing high operational costs and occasional incorrect portfolio balances. Which solution will resolve these issues most cost-effectively?
- AChange the queue to an Amazon SQS FIFO queue but continue using the existing AWS Lambda function for processing.
- BDeploy the processing application on an Amazon ECS service running on AWS Fargate, but continue using the Amazon SQS standard queue.
- Deploy the processing application on an Amazon ECS service running on AWS Fargate, and replace the Amazon SQS standard queue with an Amazon SQS FIFO queue.Cevap
- DConfigure AWS Lambda to run inside a VPC and use an Amazon Kinesis Data Stream instead of the SQS queue.
Cevap
Deploy the processing application on an Amazon ECS service running on AWS Fargate, and replace the Amazon SQS standard queue with an Amazon SQS FIFO queue.
The correct solution optimizes both cost and correctness. Utilizing Amazon SQS FIFO queues guarantees that events for each unique portfolio are processed sequentially, resolving the incorrect balances. Since the ingestion pipeline runs continuously 24/7 at a high and constant volume, hosting the consumer code in a containerized environment using Amazon ECS on AWS Fargate is significantly more cost-efficient than AWS Lambda, which incurs high costs when running continuously.
Adım Adım Çözüm
Anahtar Kavram
Selecting cost-effective compute (Lambda vs. ECS Fargate) based on workload execution continuity alongside queue ordering constraints.
Tahmini Süre:1m 30s