Software engineering · Operations & workflows

Idempotent.

Repeating an operation has the same intended effect as performing it once.

Useful when a task might be retried.

“Make this import idempotent so rerunning it does not create duplicate records.”

A closer look

An import can identify each record by a stable key and update that record instead of inserting another copy. The guarantee concerns the intended effect: repeated calls may still write separate log entries or return different status messages. Say which effect must remain unchanged.

Put it to work

“Use an idempotency key for each payment request, so retrying after a timeout cannot charge the customer twice.”

A useful distinction

Deterministic means the same input produces the same output. Idempotent concerns the effect of repeating an operation; these are different guarantees.

Further reading

HTTP Semantics · RFC 9110 §9.2.2
Revision 1 · EN