mjdeving
← concepts

Production Ops

Idempotency

Designing an action so running it twice has the same effect as running it once.

Idempotency is a property of an action: running it twice has the same effect as running it once. Charge a card idempotently and a duplicate request does not bill twice; send an email idempotently and a retry does not send two.

The property matters because repeats arrive from four directions: networks retry, jobs restart, users double-click, webhooks fire twice. Without idempotency every repeat lands as a duplicate. The standard mechanism is a key: tag each action with a stable id and check whether that id already ran, so a repeat does nothing. Retries and durable execution both depend on this one property.