How to Prevent Duplicate Lambda Payments with SQS FIFO?
Short answer
C Use an SQS FIFO queue with a Lambda poller so exactly-once processing prevents duplicate payment handling.
Question
Key Takeaways
The question tests exactly-once processing versus at-least-once delivery, and the trap is choosing DynamoDB Streams or standard SQS even though Lambda consumers can redeliver messages.
A payment processing application on AWS Lambda must avoid duplicate payments across multiple Availability Zones; Amazon SQS FIFO queues provide exactly-once processing and deduplication, making option C the correct solution.
Common mistake: Many learners pick D because DynamoDB Streams writes each record once, but Lambda stream processing is at-least-once and can retry, so duplicate payments are still possible without idempotency.
Expert Analysis
Why the Answer Is Correct
Amazon SQS FIFO queues are designed to provide exactly-once processing and deduplication: a message is delivered once and remains invisible until the consumer deletes it, and duplicates are not introduced within the 5-minute deduplication interval. That directly satisfies the requirement that the payment application must not process duplicate payments. Commenters such as hajra313 summarized this by quoting "FIFO queues provide exactly-once processing" while standard queues are only at-least-once. Lambda's SQS event source mapping can poll the FIFO queue, and high-throughput FIFO mode supports enough throughput for millions of transactions per day across partitions. The queue is also regional and durable across Availability Zones, matching the multi-AZ Lambda design.
Why the Other Options Are Wrong
Option A uses Amazon S3 event notifications, which are at-least-once and can invoke the downstream Lambda more than once for the same object or retry a failed invocation, so duplicate payments remain possible. Option B uses a standard SQS queue, which also offers at-least-once delivery and can therefore deliver the same due-payment message multiple times. Option D is the tempting distractor: DynamoDB Streams guarantees each stream record appears once in the stream, but Lambda's stream processing is at-least-once and can retry a batch, as escalibran noted, "Processing dynamo streams with lambda can cause duplication." Cali182 argued for D based on stream record uniqueness, but uniqueness in the stream does not guarantee exactly-once payment processing, and you would need idempotency or conditional writes to make D safe.
Community Comment Notes
Scheldon pointed to AWS documentation that FIFO queues do not introduce duplicates when SendMessage is retried inside the deduplication interval, and recommended option C. escalibran also raised the practical point that FIFO high-throughput mode can exceed the older 3,000 messages-per-second batched limit, addressing scalability for millions of daily transactions. One commenter said the phrase "does not process duplicate payments" is the key point that leads directly to SQS FIFO, and several others simply marked option C. Cali182's dissent for DynamoDB Streams reflects the common confusion that stream-record uniqueness equals consumer-level exactly-once processing.
Official Reference
- https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
- https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html
- https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html
These links open the official vendor documentation in a new tab.
Exam Strategy
Look for exactly-once processing cues such as “does not process duplicate,” “deduplication,” or “ordering” and map them to SQS FIFO. Differentiate FIFO from at-least-once services like standard SQS, S3 event notifications, and Lambda stream polling; DynamoDB Streams record uniqueness does not prevent Lambda re-delivery.
Frequently Asked Questions
Why is DynamoDB Streams not sufficient to prevent duplicate payments?
Can an SQS FIFO queue handle millions of payments per day for Lambda?
Community Votes
82% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 11 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 11
-
hajra313 👍 17Standard queues provide at-least-once delivery, which means that each message is delivered at least once. FIFO queues provide exactly-once processing , which means that each message is delivered once and remains available until a consumer processes it and deletes it. Duplicates are not introduced into the queue. OPTION C
-
escalibran 👍 3 Answered CC over D, because https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html Processing dynamo streams with lambda can cause duplication. SQS FIFO can be configured for High Throughput to exceed the 3000/s (batched) limit https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html I previously worked with payments and would argue that either option doesn't fully solve duplications. Events might be sent multiple times from source, you definitely want to perform de-duplication and have some sort of idempotent processing for them, instead of just blindly processing each thing you're given.
-
Scheldon 👍 3 Answered CAnswerC SQS FIFO was created for such tasks Unlike standard queues, FIFO queues don't introduce duplicate messages. FIFO queues help you avoid sending duplicates to a queue. If you retry the SendMessage action within the 5-minute deduplication interval, Amazon SQS doesn't introduce any duplicates into the queue. https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html
-
Cali182 👍 3 Answered DOption D DynamoDB Streams helps ensure the following: Each stream record appears exactly once in the stream. For each item that is modified in a DynamoDB table, the stream records appear in the same sequence as the actual modifications to the item. DynamoDB Streams writes stream records in near-real time so that you can build applications that consume these streams and take action based on the contents.
-
haci 👍 3 Answered C"The application does not process duplicate payments" is the key point, which leads us directly to SQS FIFO
Show 6 more comments
-
shahreh1 👍 2Option C: FIFO queues Exactly-Once Processing – A message is delivered once and remains available until a consumer processes and deletes it. Duplicates aren't introduced into the queue. First-In-First-Out Delivery – The order in which messages are sent and received is strictly preserved.
-
Mikado211 👍 2SQS can have duplicate messages in case of problems with the timeout window.
-
FZA24 👍 3 Answered COption C Fifo
-
asdfcdsxdfc 👍 2 Answered Cc is correct
-
kempes 👍 2Option c
-
Andy_09 👍 1Option B
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SAA-C03 Questions
Access 120 questions with complete answers and detailed explanations.
View Full SAA-C03 Practice Test →