← Lessons

quiz vs the machine

Silver1050

System Design

The Message Queue vs Log

How a traditional queue differs from a durable append only log.

4 min read · intro · beat Silver to climb

Two ways to move messages

Both a queue and a log let one service send work to another, but they keep data differently.

The classic queue

A message queue holds items until a consumer takes them. Once a message is read and acknowledged, it is removed. Each message is meant for one worker, so the queue spreads load across consumers.

The append only log

A log records messages in order and keeps them for a set time even after they are read. Consumers track their own offset, a pointer into the log. Many independent readers can replay the same messages.

Why the difference matters

  • A queue is great for task distribution where each job runs once.
  • A log is great for broadcasting events to many systems that each read at their own pace.
  • A log lets you replay history to rebuild state or onboard a new consumer.

Key idea

A queue deletes messages once consumed, while a log keeps an ordered history that many consumers replay at their own offset.

Check yourself

Answer to earn rating on the learn ladder.

1. What happens to a message in a classic queue after it is acknowledged?

2. How does a consumer track its place in a log?