Delivery Guarantees
At most, at least, exactly once.
Networks fail, and workers crash. So a message system must choose. If something goes wrong, is it better to lose a message, or to deliver it twice?

- Things go wrong
- Lose a message?
- Or deliver it twice?
Three guarantees
At most once means a message is delivered once, or not at all. Nothing is repeated, but some messages may be lost. At least once means every message arrives, but some may arrive twice. And exactly once means every message has its effect once. It's the hardest, and usually needs help from the application.
| Guarantee | Lost? | Duplicates? |
|---|---|---|
| At most once | maybe | never |
| At least once | never | maybe |
| Exactly once | never | never (hard) |
What most systems do
Most real systems choose at least once delivery, because losing an order or a payment is worse than seeing it twice. Then they make consumers handle duplicates safely. Together, that gives an effect of exactly once. That's what the next lesson is about.
| key | value |
|---|---|
| Losing data | usually worst |
| Choose | at least once |
| Then | handle duplicates |
| Result | effectively once |
Summary
Messages can be delivered at most once, at least once, or exactly once. Most systems pick at least once, and handle duplicates. Next, consumers that handle duplicates safely.
Key takeaways- At most: may lose
- At least: may repeat
- Exactly: hard