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
- webhook — An HTTP POST sent by one system to a URL on another system when an event occurs — push, not poll.
- retry — Re-attempting a failed operation, usually with exponential backoff and a maximum attempt count.