Cloud and platforms
SQS vs Service Bus vs Pub/Sub: Delivery Guarantees Compared
In short
The three services put their guarantees in different places. SQS FIFO orders per message group and deduplicates for 5 minutes. Service Bus orders through sessions and detects duplicates by MessageId over a window you set. Pub/Sub orders per key on subscriptions created for it and offers exactly-once delivery only on pull subscriptions, within one region.
How does each service keep messages in order?
Amazon SQS orders messages only in FIFO queues. Standard queues make a best-effort attempt and say messages may occasionally arrive out of order. In a FIFO queue, messages with the same MessageGroupId are processed one at a time, in strict order. While one message in a group is in flight, later messages in that group stay unavailable until it is deleted or its visibility timeout expires.
Azure Service Bus uses sessions. The sender sets a session ID, and the receiver that holds the session lock gets that session's messages in order. Once you enable sessions on a queue or subscription, clients can no longer send or receive regular messages.
Google Pub/Sub uses an ordering key. You must enable ordering on the subscription when you create it, because you cannot change it later, and you must publish same-key messages in one region. Different keys are not ordered against each other. Publishing throughput is limited to 1 MBps for each key.
Pub/Sub has the sharpest failure rule: a redelivery of a message triggers redelivery of all later messages for that key, even acknowledged ones. I would make consumers idempotent before turning ordering on.
Checked against: source 1, source 2, source 4, source 8, source 13
Where does deduplication happen?
SQS standard queues are at-least-once, so more than one copy of a message may be delivered. FIFO queues add deduplication at send time. If you retry SendMessage within the 5-minute deduplication interval, no duplicate enters the queue. You either supply a deduplication ID or enable content-based deduplication, which hashes the message body with SHA-256 and ignores attributes.
Service Bus also deduplicates at send time, keyed on the MessageId you set. A resend inside the window is reported as accepted and then silently dropped. The window defaults to 10 minutes and can run from 20 seconds to 7 days. The Basic tier does not support it.
Pub/Sub does it at delivery instead. By default it offers at-least-once delivery and warns that a message can be redelivered even after an acknowledgment returns successfully. Exactly-once delivery exists only on pull subscriptions, not push or export, and only within one region. The docs add that publish-side duplicates can still happen.
So SQS and Service Bus stop duplicates at the door, using an ID you control. Pub/Sub stops them at the subscriber, and only on one subscription type.
Checked against: source 1, source 3, source 9, source 12, source 14
How long is a message hidden once a consumer takes it?
SQS calls it the visibility timeout. The default is 30 seconds, and the range is 0 seconds to 12 hours. You can change it for one message with ChangeMessageVisibility. The 12-hour limit counts from the first receive, and extending does not reset it.
Service Bus uses a lock. The default duration is 1 minute and the maximum is 5 minutes, so longer work needs lock renewal. The docs warn that the lock is volatile: a service update, an OS update or a lost connection can drop it.
Pub/Sub uses an acknowledgment deadline. The subscription default is 10 seconds, within a range of 10 to 600 seconds. Client libraries extend it with modifyAckDeadline, up to an hour by default. The lease-management page also says deadlines are not guaranteed to be respected unless exactly-once delivery is enabled.
Checked against: source 4, source 5, source 7, source 15, source 17
How long are messages kept?
SQS keeps a message for 4 days by default. You can set anything from 60 seconds to 1,209,600 seconds, which is 14 days.
Service Bus expiry is a time-to-live on the message or on the entity. For Standard and Premium the default is the largest signed 64-bit integer, which is effectively no expiry. Basic defaults to, and is capped at, 14 days. Expired messages are dropped unless dead-lettering on expiry is on. The docs also say TTL is not enforced when no clients are actively listening.
Pub/Sub retains unacknowledged messages for 7 days by default, from 10 minutes up to 31 days. The subscription itself expires after 31 days of inactivity by default, with a minimum of 1 day, unless you set it to never expire.
What happens to messages that keep failing?
SQS needs a dead-letter queue you create first, in the same account and Region. A redrive policy sets maxReceiveCount. For a standard queue the original enqueue timestamp is kept when the message moves, so a short DLQ retention can delete it quickly. For a FIFO queue the timestamp resets. The docs also say not to use a DLQ with a FIFO queue if you must keep exact order.
Service Bus gives every queue and subscription a built-in dead-letter sub-queue that cannot be deleted or managed on its own. Maximum delivery count defaults to 10 and cannot be disabled. Nothing cleans the DLQ automatically, and TTL is not observed inside it. In a session, the receiver keeps getting later messages after one is dead-lettered. A resubmitted message loses its original place.
Pub/Sub forwards to a dead-letter topic after 5 to 100 delivery attempts, with 5 as the default. Google calls this best-effort. A message may be forwarded after fewer attempts or a few more than configured, so I would not build logic that depends on an exact count.
Which difference should drive your choice?
Pick by the guarantee you cannot rebuild cheaply in your own code.
- Duplicate sends from retried publishers: SQS FIFO and Service Bus both handle it with an ID, within a window you must size.
- Per-key order with parallel workers: all three can do it, but the ordered unit is a message group, a session or an ordering key, and each fails differently.
- Replays after failure: Pub/Sub ordering replays the rest of the key, so plan idempotent consumers.
- Mixed consumers: if you need push delivery and exactly-once together, the Pub/Sub docs say that combination is not offered.
What else do people ask?
Is SQS exactly-once?
Only FIFO queues are described that way, and the guarantee is that deduplication prevents duplicates entering the queue within 5 minutes. Standard queues are at-least-once.
Does Service Bus guarantee order without sessions?
Its docs say a sequence number guarantees queuing and extraction order but not processing order, which requires sessions.
Sources
- Amazon SQS, standard queues, fetched 2026-11-19
- Amazon SQS, FIFO queues, fetched 2026-11-19
- Amazon SQS, exactly-once processing, fetched 2026-11-19
- Amazon SQS, visibility timeout, fetched 2026-11-19
- Amazon SQS, message quotas, fetched 2026-11-19
- Amazon SQS, dead-letter queues, fetched 2026-11-19
- Microsoft Learn, Service Bus message transfers, locks and settlement, fetched 2026-11-19
- Microsoft Learn, Service Bus message sessions, fetched 2026-11-19
- Microsoft Learn, Service Bus duplicate detection, fetched 2026-11-19
- Microsoft Learn, Service Bus dead-letter queues, fetched 2026-11-19
- Microsoft Learn, Service Bus message expiration, fetched 2026-11-19
- Google Cloud, Pub/Sub subscription overview, fetched 2026-11-19
- Google Cloud, Pub/Sub message ordering, fetched 2026-11-19
- Google Cloud, Pub/Sub exactly-once delivery, fetched 2026-11-19
- Google Cloud, Pub/Sub subscription properties, fetched 2026-11-19
- Google Cloud, Pub/Sub dead-letter topics, fetched 2026-11-19
- Google Cloud, Pub/Sub lease management, fetched 2026-11-19
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. This page compares vendor documents that I fetched on 19 Nov 2026. I did not run SQS, Service Bus or Pub/Sub for it, so it reports documented behaviour, not observed behaviour. It does not cover prices, throughput, or per-language client details. Found a mistake? Tell me.