Idempotency.
also: idempotent · idempotence · idempotently · non-idempotentAn operation is idempotent if doing it many times has the same effect as doing it once.
the two-minute refresher
- 'Set the thermostat to 72' is idempotent; 'add $10 to the account' is not.
- Networks force retries: a timeout doesn't tell you whether the request happened.
- So any retried operation must be safe to repeat, or you double-charge and double-send.
- GET, PUT and DELETE are idempotent by HTTP's definition; POST is not, so it needs an idempotency key.