Idempotent
/ˌaɪ.dɛmˈpoʊ.tənt/ · Adjective · Development
Definitions
An operation that produces the same result whether executed once or multiple times. Critical in distributed systems where network failures mean you might accidentally send the same request twice.
In plain English: Something you can do over and over and get the same result — like pressing an elevator button: pressing it 10 times doesn't call 10 elevators.
Example: "PUT is idempotent. POST is not. If you don't understand the difference, you'll charge someone's credit card seventeen times."
Etymology
- 1870
- Mathematician Benjamin Peirce coins 'idempotent' from Latin idem (same) + potens (power) for operations where f(f(x)) = f(x)
- 2000
- Roy Fielding's REST dissertation emphasizes HTTP method idempotency (GET, PUT, DELETE), bringing the concept to web developers
- 2010s
- Idempotency becomes critical in distributed systems — payment APIs, message queues, and infrastructure-as-code all rely on it
Origin Story
The math concept that keeps your API from double-charging customers
An operation is **idempotent** if performing it multiple times has the same effect as performing it once. The word comes from Latin: *idem* (same) + *potent* (power) — literally "same power." In mathematics, a function *f* is idempotent if *f(f(x)) = f(x)*. For example, taking the absolute value is idempotent: `abs(abs(-5))` equals `abs(-5)`.
The concept entered computing through HTTP specification discussions. RFC 2616 (HTTP/1.1, 1999) formally defined GET, PUT, and DELETE as idempotent methods: sending the same request multiple times should produce the same server state as sending it once. POST, notably, is *not* idempotent — submitting a form twice might create two records.
Idempotency became critically important in distributed systems and payment processing. Network failures mean requests often get retried automatically. If charging a credit card isn't idempotent, a retry could charge the customer twice. This is why Stripe, PayPal, and other payment APIs support **idempotency keys** — unique tokens that ensure a retried request won't process again.
Coined by: Benjamin Peirce (mathematical concept, 1870)
Context: Mathematics, 1870; HTTP/computing adoption, 1990s
Fun fact: The HTTP specification's idempotency rules are frequently violated in practice. Many APIs that claim to be RESTful use POST for operations that should be PUT (idempotent), leading to the joke that REST stands for 'Rarely Exactly Satisfies Theory.'
Related Terms
- REST
- Message Queue
- Idempotency Key
- idempotency
- Division
- Figure
- Function Handle
- HPC
- Library
- Optional
- Replication
- Safety-Critical
- Transaction
- Vapi
- Idempotency Key
- Dead Letter Queue
- Chaos Monkey
- Idempotent Pipeline
- Canary Analysis
- Error Boundary
- Error Code
- Error Correction
- Error Handling
- Error Recovery
- Error Type
- Mutation
- Schema Validation
- SvelteKit
- Turbo
- Category Theory