Design Resilient Architectures

An order-processing worker consumes messages from an Amazon SQS standard queue, which can deliver a message more than once. Which design prevents repeated deliveries from creating duplicate orders?

Show the answer

Correct answerD. Atomically record each request ID and create an order only once.

AWhy not this: More workers increase processing capacity but do not prevent duplicate business operations.

BWhy not this: Deleting before processing risks losing an order if the worker fails and does not reliably prevent duplicates.

CWhy not this: A longer timeout can reduce premature redelivery but cannot guarantee that duplicate messages never arrive.

DWhy this is right: Atomic deduplication ensures repeated processing of the same request does not create another order.

An idempotent consumer uses a stable request ID and atomic processing to prevent duplicate business effects. A longer visibility timeout reduces some repeat deliveries but does not eliminate the standard queue's at-least-once delivery behavior.