Overview
A message queue and an event log both move data from producers to consumers, but they differ in what happens after a message is read. A queue treats delivery as a one-time handoff where each message is consumed once and then removed, while an event log keeps every event in an ordered, replayable sequence that multiple independent readers can consume at their own pace. This distinction drives how each handles multiple consumers, failure recovery, and historical reprocessing.
Comparison Diagram
Comparison Table
| Aspect | Queue | Event Log |
|---|---|---|
| Write path | Producer sends the message directly to the queue | Producer appends the event to the end of the log |
| Storage structure | Transient buffer of discrete messages | Append-only, ordered, persistent sequence |
| Consumption mechanic | Consumer pops/dequeues a message and acknowledges it | Consumer reads sequentially and tracks its own offset |
| Multiple consumers | Competing consumers — each message goes to only one consumer | Broadcast — every consumer group gets its own full copy of the stream |
| Retention after read | Message is deleted once acknowledged | Event stays retained per policy regardless of who has read it |
| Replay capability | Not possible without re-publishing the message | Trivial — reset the offset and re-read from any point |
| Ordering guarantee | FIFO within the queue, but no guaranteed order across consumers | Strict order guaranteed within a partition |
| Failure recovery | Failed messages route to a dead-letter queue for retry | Consumer resumes by rewinding to its last committed offset |
Key Differences
- A queue’s message disappears after acknowledgment; a log’s event stays put
- Queues split work across competing consumers; logs broadcast to every consumer group
- Logs support full replay from any offset; queues generally don’t
- Log ordering is partition-scoped and strict, while queue ordering is best-effort across consumers
- Queues excel at task distribution; logs excel at event sourcing and stream processing
When to Use Each
Queue
- Task distribution: Spread discrete units of work across a pool of workers where each task should be handled exactly once.
- Request buffering: Smooth out bursts between a fast producer and a slower downstream service without needing history.
- Simple decoupling: Decouple two services with minimal operational overhead when neither replay nor multi-consumer fan-out is required.
Event Log
- Event sourcing: Rebuild application state by replaying the full history of events from the beginning of the log.
- Multiple independent consumers: Let several services — analytics, search indexing, notifications — each read the same stream at their own pace.
- Stream processing pipelines: Support windowed aggregations and joins that need to reprocess historical events.