Learning path

Full curriculum

Full curriculum

Unit content

Idempotency and request deduplication

An operation is idempotent when repeating it with the same intended input has the same effect as performing it once.

Setting a resource to a particular value can be idempotent; incrementing it is not.

Idempotency makes retries safer because duplicate execution does not compound the state change. When the operation itself is not naturally idempotent, a protocol can attach a unique request identifier and remember completed identifiers so repeated delivery returns the previous result instead of performing the effect again.

This deduplication needs a defined scope and retention period. Forgetting an identifier too early can allow an old retry to execute again.

Idempotency is an application property. A reliable transport can retransmit bytes, but it cannot decide whether executing the represented business operation twice is acceptable.