A financial services company is designing a transaction processing system. The system receives account balance update messages that must be processed in the exact sequence they are received to prevent reconciliation errors. The volume of these messages is highly unpredictable, characterized by sudden bursts of activity followed by long periods of idle time. Each message takes approximately milliseconds to process. The company requires a highly cost-effective, serverless architecture that scales automatically to handle peak loads and incurs no compute costs during idle periods.
Which solution meets these requirements?
- AConfigure an Amazon SQS standard queue to receive the messages. Configure an AWS Lambda function with the queue as an event source to process the messages and write the results to an Amazon DynamoDB table configured with on-demand capacity mode.
- Configure an Amazon SQS FIFO queue to receive the messages. Configure an AWS Lambda function with the queue as an event source to process the messages and write the results to an Amazon DynamoDB table configured with on-demand capacity mode.Answer
- CConfigure an Amazon SQS FIFO queue to receive the messages. Deploy a fleet of Amazon EC2 instances in an Auto Scaling group to poll the queue, process the messages, and write the results to an Amazon DynamoDB table configured with provisioned capacity mode.
- DConfigure an Amazon SQS FIFO queue to receive the messages. Deploy an AWS Lambda function configured with a maximum timeout of minutes that runs a continuous polling loop to retrieve and process messages from the queue, writing the results to an Amazon DynamoDB table configured with on-demand capacity mode.
Answer
Configure an Amazon SQS FIFO queue to receive the messages, use an AWS Lambda function triggered by the queue via event source mapping to process the updates, and store the results in an Amazon DynamoDB table configured with on-demand capacity mode.
The correct solution uses an Amazon SQS FIFO queue to guarantee message ordering, an AWS Lambda function triggered by the queue to process updates dynamically with zero idle compute costs, and Amazon DynamoDB on-demand capacity mode to handle unpredictable traffic spikes cost-effectively.
Step-by-Step Solution
Key Concept
Building highly cost-effective, event-driven architectures with AWS Lambda, Amazon SQS FIFO, and Amazon DynamoDB on-demand to handle unpredictable, ordered transactional workloads while scaling to zero during idle periods.