ADR 0006: Idempotency For Write Operations

Ratification

Adopted before ADR 0018. There was no separate ratification process. Git history for this file on main is the record.

Context

Why this matters: Networks drop packets; clients time out and retry; mobile apps tap “submit” twice. If the server treats every retry as a new action, you get duplicate users, double charges, or conflicting updates. Idempotency means: “send the same logical request again with the same key, and the server does not apply the side effect twice—it returns the same outcome as the first success.”

This is usual for payment and write APIs; we use it for critical writes so integrations stay safe when clients retry.

Decision

  1. All critical write operations must support idempotent retry behavior.
  2. Client sends Idempotency-Key for write requests.
  3. Server deduplicates by (endpoint, idempotency_key, payload_hash).
  4. Same key + same payload replays original success response.
  5. Same key + different payload returns conflict error.

Initial Implementation

Contract Impact

Consequences

Positive

Trade-offs

Page history

Date Change Author
Added Page history section (repository baseline). Ivan Boyarkin