idempotent
C2Pronunciation
UK
- /ˈaɪdmpəʊtənt/
US
- /aɪˈdɛm.pə.tənt/not-comparableadjective
- /aɪˈdɛm.pə.tənt/noun
- /ˌaɪ.dəmˈpoʊ.tənt/not-comparableadjective
- /ˌaɪ.dəmˈpoʊ.tənt/noun
- /ˌɪ.dəmˈpoʊ.tənt/not-comparableadjective
- /ˌɪ.dəmˈpoʊ.tənt/noun
Description
- Repeating an action has no extra effect
- Same result after the first time
- No further change when repeated
Imagine a button labeled "Power On." Pressing it once turns the device on. Pressing it again does not make the device any more on. It just stays on. That is the essence of being idempotent: doing the same action many times gives the same result as doing it once.
This idea is important in math and computer science. An "idempotent operation" is one where repeating it does not change the result after the first time. Think of setting a digital volume slider to 50%. Doing it once sets the level; doing it ten more times leaves it exactly at 50%. It is all about consistency: the result stays the same no matter how many times you apply the action.
The word "idempotent" is derived from the Latin idem (same) and potens (power). While it may sound like high-level jargon, the core idea is intuitive: it describes an action that can be repeated indefinitely without changing the result beyond the initial application. It's about reaching a stable state where further repetition leads to no further change.
The term was coined in the 19th century within the field of mathematics, specifically in algebra. A mathematical operation is idempotent if applying it to its own result yields that same result again. A classic example is the absolute value function: the absolute value of -5 is 5, and the absolute value of 5 is still 5. No matter how many times you wrap the number in that function, the result remains locked at 5.
In the modern era, "idempotent" has become a cornerstone of computer science and software engineering. In programming, an idempotent operation is one that can be safely retried without unintended side effects. This is crucial for building reliable systems that can survive network glitches. For instance, a database command to "set user status to 'active'" is idempotent; if a network error causes the command to be sent twice, the status remains "active." Conversely, a command like "add 1 to total points" is not idempotent, because repeating it would incorrectly inflate the score.
You encounter this in daily digital life as well. Consider a setting like "turn notifications off": once notifications are off, choosing that option again does not change anything further. Similarly, well-designed "submit" buttons in financial apps are often idempotent to ensure that if you tap the button twice because of a laggy screen, you do not accidentally send the same payment twice. Ultimately, idempotency provides a guarantee of predictability and safety in a world where repetitions are often accidental.
Examples
- 1
API safety
This API call is idempotent, so sending it twice will not create two accounts.
- 2
Payment requests
We made the payment request idempotent to protect users from double charges during network failures.
- 3
Distributed systems
In distributed systems, engineers prefer idempotent operations because retries are much safer.
Forms and spellings
1 form open this card.
Main spelling
- idempotentadjective