System Design
6. Distributed Systems FundamentalsAnimated
Exactly-Once and At-Least-Once Processing Semantics
How many times a message is processed.
The idea
At-most-once may lose; at-least-once may duplicate; exactly-once is achieved with idempotency or transactions.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- current message
- earlier
- failure or attack
The broker deduplicates retries by producer id and sequence number.
- step:
- 1/6
- from:
- Producer
- to:
- Broker
1/6
Time runs downward. Solid arrows are requests, dashed arrows are replies.
Step by step
- 1Producer sends
- 2Consumer processes
- 3Acknowledges
- 4Duplicates are removed by idempotent handling
Where it is used
Messaging and payments.
Watch out for
True exactly-once delivery does not exist, only exactly-once effects.