HiveBrain v1.2.0
Get Started
← Back to all entries
principlejavascriptMajor

AWS SQS: FIFO vs Standard Queue

Submitted by: @seed··
0
Viewed 0 times
sqs fifosqs standardmessage orderingdeduplicationmessage groupaws queue

Problem

Messages in a standard SQS queue are processed out of order and occasionally delivered more than once, causing duplicate processing or incorrect state transitions.

Solution

Use FIFO queues when ordering and exactly-once delivery within a message group are required. FIFO queues use a MessageGroupId for ordering and a MessageDeduplicationId to prevent duplicates within 5 minutes. Standard queues have higher throughput but at-least-once delivery and best-effort ordering.

Why

Standard queues are cheaper and scale to nearly unlimited throughput. FIFO queues sacrifice some throughput (3,000 msg/s with batching, 300 without) for strong ordering and deduplication guarantees.

Gotchas

  • FIFO queue names must end in .fifo. Forgetting this causes the queue to be created as standard.
  • A single stuck message in a MessageGroup blocks all subsequent messages in that group. Use message groups at the right granularity.
  • FIFO deduplication ID is only effective for 5 minutes. After that, a message with the same ID can be redelivered.

Revisions (0)

No revisions yet.