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.