/aɪˈdɛm.pə.tənt/

adjective — “do it once, do it twice, and your system yawns politely instead of exploding.”

Idempotent is a concept in computing and mathematics that describes operations or functions that can be applied multiple times without changing the result beyond the initial application. In other words, performing an idempotent action once or many times produces the same outcome, making it predictable, safe, and repeatable. This property is especially valued in API Design, network protocols, and distributed systems where retries or duplicated requests are common.

In practical terms, idempotency ensures that systems can recover gracefully from errors, network interruptions, or repeated commands without unintended side effects. For example, a payment API that is idempotent allows a client to retry a transaction request multiple times, and the customer will only be charged once. Similarly, setting a user’s status to “active” repeatedly does not change the system state after the first application.

Idempotent operations often interact with concepts like Standardization and Data Validation to enforce consistency. In HTTP, certain methods are defined as idempotent: GET, PUT, and DELETE (when properly implemented). Performing these requests multiple times produces the same server state, making clients and servers easier to reason about.

Some illustrative examples:

// Idempotent function example in Python
def set_status(user, status):
    user.status = status  # setting multiple times has no additional effect

# HTTP example (pseudo-code)
PUT /users/123/status
{
  "status": "active"
}
// Sending this PUT request multiple times keeps the user active without duplication

// Database example
UPDATE users SET active = TRUE WHERE id = 123;
// Running this query multiple times does not change the outcome after the first execution

Idempotent is like hitting the “refresh” button repeatedly on a page: no matter how many times you press it, the page ends up exactly the same—no drama, no duplicates, just reliable behavior.

See API Design, Data Validation, Standardization, Network Protocol, Error Handling.