Question #1804
A solutions architect is designing a transaction processing system for a financial institution. The system uses AWS Lambda functions deployed in private subnets across three Availability Zones. It processes hundreds of thousands of transactions daily and must guarantee that each transaction is processed exactly once to prevent financial discrepancies.
Which solution will satisfy these requirements?
Use Lambda to fetch pending transactions and store them in an Amazon S3 bucket. Configure an S3 event notification to trigger another Lambda function for processing each transaction.
Use Lambda to fetch pending transactions and send them to an Amazon SQS standard queue. Configure a second Lambda function to poll the queue and process transactions.
Use Lambda to fetch pending transactions and send them to an Amazon SQS FIFO queue. Configure another Lambda function to poll the FIFO queue and process each transaction.
Use Lambda to write pending transactions into an Amazon DynamoDB table. Enable DynamoDB Streams to invoke a second Lambda function for processing each transaction.
Explanation
Answer C is correct because:
1. FIFO Queues Ensure Exactly-Once Processing: Amazon SQS FIFO queues use deduplication IDs and message groups to ensure each transaction is processed exactly once, meeting the requirement to prevent financial discrepancies.
2. Ordering: FIFO queues maintain the order of transactions, which is often critical for financial systems.
Why other options are incorrect:
- A: S3 event notifications can trigger duplicates if multiple writes occur, risking reprocessing.
- B: Standard SQS queues provide 'at-least-once' delivery, which may result in duplicate processing.
- D: DynamoDB Streams use 'at-least-once' semantics, requiring application-level deduplication.
Key Points: Use SQS FIFO queues for exactly-once processing in transaction systems. Avoid S3 events, standard queues, or DynamoDB Streams when duplicates are unacceptable.
Answer
The correct answer is: C