Skip to main content
Definition Website Computer and Technology

Idempotency

Subject: Computer and Technology noun /ˌaɪ.dəmˈpoʊ.tən.si/ 1 definition

  1. Definition (noun)

    Entry #76 · Updated

    Idempotency is a computing property of an operation whereby executing it multiple times produces the same system state and side effects as executing it once. In distributed systems, web APIs, and infrastructure automation, it acts as a critical safeguard against duplicate mutations caused by network timeouts, message redeliveries, and automated client retries. While subsequent calls to an idempotent operation may yield a different status code or a cached response—such as deleting an already removed record—its core boundary is guaranteeing that repeated invocations never create unintended duplicate state changes.

    Common Forms

    • Idempotent HTTP Methods: Protocol-level semantics for methods such as GET, PUT, and DELETE, where repeating an identical request leaves server-side resource state identical to a single execution, unlike non-idempotent POST requests.

    • Idempotency Keys: Client-generated unique tokens sent with state-changing requests so servers can recognize duplicate retries, skip re-execution, and return the original stored response.

    • Conditional Writes and Upserts: Database operations—such as UPSERT statements, unique-constraint enforcement, or optimistic concurrency version checks—that ensure repeated inserts or updates converge to a single consistent record state.

    • Declarative Configuration Management: Infrastructure-as-code and orchestration workflows that compare live system state against a desired specification and apply changes only when drift exists, making repeated runs yield identical environments.

    Example

    When a customer taps "Pay Now" on an unstable mobile network, the checkout app sends a POST /charges request with a unique UUID in the Idempotency-Key header and retries the identical request after a five-second timeout. Because the payment gateway already recorded that key during the initial request, it skips charging the card a second time and returns the original 201 Created transaction receipt.