Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Courses/Asynchronous and Event-Driven Systems
Lesson 5 of 20

Message brokers compared

Queue brokers, log brokers and managed services: what each is good at and how to pick one.

15 min read

Two families

Brokers come in two broad shapes. Queue brokers (RabbitMQ, Amazon SQS, ActiveMQ) track every message individually: a consumer receives it, acknowledges it, and the broker deletes it. They are built for distributing tasks to workers. Log brokers (Kafka, Amazon Kinesis, Pulsar, Redpanda) append messages to partitioned logs and keep them for a retention period whether or not anyone has read them. Consumers remember their own position (offset), so many independent consumer groups can read the same data, and any of them can rewind and replay. If you need a job done once, think queue; if you need a history many systems read, think log.

The common options

Each broker makes a different set of trade-offs. These numbers are rough orders of magnitude, but they are the ones that usually decide the choice.

  • SQS standard: fully managed, practically unlimited throughput, at-least-once, best-effort ordering, messages kept up to 14 days
  • SQS FIFO: ordering per message group and deduplication within a 5-minute window; about 300 operations per second per queue (3 000 messages with batching) unless high-throughput mode is on
  • RabbitMQ: flexible routing through exchanges (direct, topic, fanout), per-message acks, priorities; tens of thousands of messages per second per node
  • Kafka: replicated partitioned log, millions of messages per second per cluster, retention for days or forever, ordering per partition
  • Redis lists and streams: very fast and simple, but durability depends on how Redis persistence is configured

Questions that pick the broker

Start from requirements, not brand names. Do several independent services need the same events, or does each message need exactly one worker? Will you ever need to replay history, for example to rebuild a search index or backfill a new consumer? Do you need per-message features such as delays, priorities or routing by pattern? What throughput and message size do you expect at peak? Who will run it at 3 a.m.? A managed queue is the right default for background jobs; a log earns its operational cost when you have high volume, multiple consumers or replay.

Combining them

Large systems often use both. A Kafka topic carries the canonical stream of domain events, and a consumer turns the events that need work into tasks on a job queue with retries and delays. On the SystCode canvas, choose the component that matches the semantics you need: a queue for work that should be done once, a stream for facts many consumers read.

Key takeaways

  • Queue brokers delete messages after acknowledgement; log brokers retain them and let consumers replay
  • Pick by semantics first: one worker per job, or many readers of a shared history
  • Prefer managed services unless scale or cost forces you to run your own
  • Many systems pair a log for events with a queue for tasks

Sign in to track lessons and earn badges.

Streams, logs and delivery guaranteesIdempotent consumers and effectively-once processing

Coming up

Course: 0/20 lessons · 0/10 challenges0%

Build it on the canvas, pass the review (70+) and mark it complete to count it toward the course badge.

  1. 2/10Design a Notification SystemFan notifications out to slow providers with idempotent sends, backoff with jitter and a dead-letter queue.Medium
  2. 3/10Design a Newsletter SenderDrain 5 million sends through a rate-limited email provider without overwhelming it or sending twice.
Easy
All 10 challenges →