# Idempotency

Record: `arch:idempotency`
Kind: principle
Layer: [Atomic Boundary](https://banes-lab.com/records/layer/atomic-boundary.md)
Severity: mandatory
Scope: API, command, message handler
Canonical: https://banes-lab.com/ontology#arch-idempotency

## Repair

- Refactored by: Add Idempotency Key, Add Dedup Store
- Detected by: side-effectful handlers without deduplication
- Violated by: duplicate charges/orders/messages on retry
- Measured by: duplicate-effect defect rate
- Enforced by: retry tests, API policy

## requires

- [Idempotency Key or Deterministic Operation](https://banes-lab.com/records/lex/idempotency-key-or-deterministic-operation.md)

## reinforces

- [Retry Safety](https://banes-lab.com/records/lex/retry-safety.md)
- [Event-Driven Architecture](https://banes-lab.com/records/arch/event-driven-architecture.md)

## enables

- [Safe Retries](https://banes-lab.com/records/lex/safe-retries.md)

## conflicts-with

- [Non-Repeatable Side Effects](https://banes-lab.com/records/lex/non-repeatable-side-effects.md)

## tensions-with

- [State Tracking](https://banes-lab.com/records/lex/state-tracking.md)

## tensions

- [Idempotency State Tracking](https://banes-lab.com/records/tension/idempotency-state-tracking.md)

## referenced-by

- [Retry Pattern](https://banes-lab.com/records/arch/retry-pattern.md)
- [Event-Driven Architecture](https://banes-lab.com/records/arch/event-driven-architecture.md)
- [Eventual Consistency](https://banes-lab.com/records/arch/eventual-consistency.md)
- [Saga Pattern](https://banes-lab.com/records/arch/saga-pattern.md)
- [Canonicalization](https://banes-lab.com/records/arch/canonicalization.md)
