idempotency

A property of an operation where calling it twice has the same effect as calling it once.

Definition

An operation is idempotent if running it N times produces the same end state as running it once. Critical for webhook receivers, retry-on-failure systems, and any distributed pipeline where the same message can arrive twice. Achieved with a deduplication key (event ID, request ID) checked against a store before the side effect runs.

When to use

Design every webhook handler, queue consumer, and retry-prone API call to be idempotent. The cost of getting it wrong is duplicate charges, duplicate emails, or duplicate records.

See also

Mentioned in