Distributed Systems Pattern: Idempotent Receiver

This post was originally published on this site

Martin Fowler

SolutionAt-most once, At-least once and Exactly Once actions

Depending on how the client interacts with the server, the guarantee of whether the server will do certain action is predetermined. If a client experiences a failure after the request is sent, and before receiving the response, there can be three possibilities.

If the client doesn’t retry the request in case of failure, the server might have processed the request, or might have failed before processing the request. So the request is processed at the most once on the server.

If the client retries the request, and the server had processed it before communication failure, it might process it again. So the request is processed at least once, but can be processed multiple times on the server.

With idempotent receiver, even with multiple client retries, the server processes the request only once. So to achieve ‘exactly once’ actions, its important to have

To read the full article click on the 'post' link at the top.