Pattern 23 / RESILIENCE

Idempotency

Use this when making retries safe when clients cannot know if a write succeeded.

Pressure
Making retries safe when clients cannot know if a write succeeded
Mechanism
Deduplicate requests with an idempotency key or natural operation identity
Toll
Requires storing keys/results and checking duplicates on the write path
Architecture plate23
Diagram for Idempotency
Executive brief

Idempotency fits when making retries safe when clients cannot know if a write succeeded. Mechanism: deduplicate requests with an idempotency key or natural operation identity. Use it for payments, order creation, message handling, and any retried write API. The toll: requires storing keys/results and checking duplicates on the write path.

Use when

Payments, order creation, message handling, and any retried write api.

Example

Same payment key returns original charge instead of charging twice.

Review framing

Describe the pressure first, then the mechanism, then the cost. That keeps the design grounded.

Same pressure family

Reliability Patterns

19Circuit Breaker20Retry with Exponential Backoff21Bulkhead22Timeout24Dead Letter Queue (DLQ)25Graceful Degradation
โ† 2224 โ†’