AWS Certified Developer – Associate (DVA-C02)Development with AWS ServicesMedium

A developer is building a new application that processes financial transactions. Each transaction must be processed exactly once, even if the processing system experiences failures or retries. The application uses an Amazon SQS queue for incoming transactions. Which SQS queue type should the developer use to guarantee exactly-once processing?

  1. ADelayed Queue
  2. BDead-Letter Queue
  3. CStandard Queue
  4. DFIFO Queue
Show answer & explanation

Correct answer: D. FIFO Queue

Amazon SQS FIFO (First-In, First-Out) queues guarantee that messages are processed exactly once and in the exact order that they are sent and received. This is crucial for financial transactions where message order and exactly-once processing are paramount.

Why the other options are wrong

  • A. Delayed Queues are used to postpone the delivery of messages, not to guarantee exactly-once processing or ordering.
  • B. Dead-Letter Queues handle messages that fail processing; they don't provide exactly-once semantics for initial processing.
  • C. Standard Queues offer at-least-once delivery and best-effort ordering, not suitable for exactly-once processing or strict ordering.

Amazon SQS FIFO Queue

Amazon SQS FIFO (First-In, First-Out) queues guarantee that messages are processed exactly once, in the exact order that they are sent and received.

  • Exactly-once processing.
  • Strict message ordering.
  • Message deduplication.

Memory trick: For ordered and exactly once, FIFO is the SQS dance.

More Development with AWS Services questions