Idempotency
Also called: Idempotent
An operation is idempotent if doing it twice has the same effect as doing it once.
Definition
Networks fail, so clients retry. Retrying an idempotent request is safe: GET, PUT and DELETE are idempotent by definition. POST isn't, so a retried POST can create a duplicate. APIs that handle money usually accept an idempotency key with each POST and return the stored result when the same key arrives again.
In practice
The app times out while paying and retries. With an idempotency key, the customer is charged once, not twice.
Learn it in context
Lessons that use this term.