Guide

Every queue product does the same basic job: hold messages, deliver them to workers, and track acknowledgements. The differences are in who runs it, how it routes messages, and what it guarantees. Pick the product after you know the shape of your work.

The big idea

Ask three questions before you look at a product:

  1. Who operates it? A managed service removes the ops work. A self-hosted broker gives you control.
  2. How do messages route? One consumer per message, fan-out to many, or complex routing rules?
  3. Do you need replay? Can a new consumer read history, or is a message gone once it is acked?

Concept

Replay means reading messages again from a stored history, usually to rebuild state or start a new consumer. Queues usually delete acked messages. Logs such as Kafka keep them. See event streaming.

Comparing the four

Amazon SQSRabbitMQGoogle Cloud Pub/SubRedis Streams
ModelQueue (pair with SNS for fan-out)Broker with exchanges that route to queuesTopics with subscriptionsAppend-only stream with consumer groups
OperationsFully managedYou run it, or use a managed versionFully managed, globalPart of your Redis deployment
DeliveryAt-least-once; FIFO queues add a dedup windowAt-least-once with manual acksAt-least-once; exactly-once on pull subscriptions is optionalAt-least-once via pending entries and XACK
OrderingBest-effort; per message group in FIFOPer queue, one consumerPer ordering key, opt-inPer stream
Retention1 minute to 14 daysUntil consumedUp to 7 days for unacked messagesUntil trimmed
Good fitAWS workloads, minimal opsComplex routing, low latency, on-premGCP workloads, global fan-outLightweight jobs when Redis is already running

Product limits change over time, so check the current documentation before you design around a number.

Walking through a decision

Suppose you run on AWS, you have no ops team, and you need to send emails for each order.

  1. Operations: no ops team, so a managed service.
  2. Routing: one email per order, plus a few other teams need the event. You need fan-out, so SNS plus SQS.
  3. Replay: not needed. Once an email is sent, the message can go.

The answer is SNS to several SQS queues. Had you needed replay for a new analytics team, Kafka or Kinesis would be a better fit.

Large messages

Most queues limit message size. SQS messages are capped at 1 MiB. For larger payloads, store the file in object storage and put a pointer in the message. This pattern is called the claim check.

Tip

Don't pick a queue because a team you admire uses it. Write down your answers to the three questions above, and check which products meet them.

Common mistakes

  • Choosing for features you won't use. Complex routing is expensive to operate if you have one queue.
  • Assuming "FIFO" means exactly-once. It means ordering within a group, and a dedup window. It does not stop a consumer from processing a redelivered message twice.
  • Using Redis as a durable queue without thinking about persistence. Check how your Redis is configured before you trust it with orders.

Key takeaways

  • The queue products differ in operations, routing, ordering and retention.
  • Choose by the three questions: who runs it, how it routes, and whether you need replay.
  • For large payloads, store the data elsewhere and send a pointer.

Further learning

Next, see how multi-step processes survive crashes in durable workflows.