...

/

The Tale of Exactly-Once Semantics

The Tale of Exactly-Once Semantics

Know the story behind the exactly-once semantics.

Multiple deliveries of a message

Various nodes of a distributed system communicate with each other through the exchange of messages.

As the network is not reliable, these messages might get lost. Of course, to cope with this, nodes can retry with the hope that the network will recover at some point and deliver the message.

However, this means that the nodes may deliver messages multiple times because the sender can’t know what really happens.

The following illustration shows what happens when a node doesn’t deliver a message at all.

The following illustration shows a message that a node delivers twice.

This duplicate delivery of a message can create disastrous side effects.

Example consequence

Think about what would happen if the message is supposed to signal the transfer of money between two bank accounts as part of a purchase. The bank may charge a customer twice for a product.

Avoiding multiple deliveries of a

...