Models
Persistence and retention
Persistence = does the broker store the message?
Retention = how long does the broker keep the stored message?
| Model |
Persistence |
Retention |
| Event Log |
Persistent |
Retain until time/size policy removes it |
| Message Queue |
Usually persistent |
Retain until acknowledged or expired |
| Durable Pub/Sub |
Persistent |
Retain until subscriber state/retention policy allows removal |
| Ephemeral Pub/Sub |
Not persistent |
Do not retain for offline subscribers |
ACK semantics
| Model |
What ACK means |
| Event Log |
Consumer finished up to a position; message remains |
| Message Queue |
Consumer finished the message; broker can remove it |
| Durable Pub/Sub |
Subscriber finished the message; broker records progress |
| Ephemeral Pub/Sub |
Usually no durable ACK state |
Delivery guarantees
| Guarantee |
Meaning |
| At-most-once |
Message may be lost, but is not redelivered |
| At-least-once |
Message is not normally lost, but may be delivered more than once |
(Solution: Consumers should usually be idempotent.) |
| Exactly-once | Processing effect happens once under specific system guarantees |
| Model |
Common default |
| Event Log |
At-least-once |
| Message Queue |
At-least-once |
| Durable Pub/Sub |
At-least-once |
| Ephemeral Pub/Sub |
At-most-once / best effort |
Ordering
| Model |
Typical ordering guarantee |
| Event Log |
Usually partition-level ordering |
| Message Queue |
Usually queue-level or limited ordering |
| Durable Pub/Sub |
Usually limited or key-based ordering |
| Ephemeral Pub/Sub |
Usually weak or best-effort ordering |
Note that distributed messaging systems usually guarantee ordering within some scope, not globally.
Replay
Read a message again after it was already successfully processed. Majorly, this is the Even Log concept.
| Model |
Replay old messages? |
| Event Log |
Yes, this is the core feature of event logs. |
| Message Queue |
Usually no |
| Durable Pub/Sub |
Sometimes, depending on retention and subscription state |
| Ephemeral Pub/Sub |
No |
Consumer group (same group)
One logical handler scales horizontally. Each message is assigned to one worker in that group. Majorly, this is the Even Log and Message Queue concept.
| Model |
Supported? |
| Event Log |
Yes, common |
| Message Queue |
Yes, common |
| Durable Pub/Sub |
Usually yes |
| Ephemeral Pub/Sub |
Depends on product |
Most production systems offer a message to one consumer in a consumer group per delivery attempt, but cannot generally guarantee exactly-once business processing. A message may be redelivered after a timeout, crash, or failed acknowledgement. Consumers use idempotency, deduplication, transactional outbox/inbox patterns, and careful acknowledgement timing to make repeated deliveries safe.
Fan-out (different group)