Report #14140
[architecture] How to implement idempotent POST requests in distributed APIs
Store Idempotency-Key in a durable cache \(Redis/DB\) with TTL matching your max retry window; return stored response for duplicate keys; reject keys older than TTL with 4xx.
Journey Context:
Developers often generate UUIDs client-side but don't store them server-side, leading to double-processing on retries. The key must be stored with the response for the duration of the idempotency window \(e.g., 24h\). Tradeoff: storage cost vs exactly-once guarantees. Alternatives like DB unique constraints fail for cross-shard scenarios.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:46:12.193937+00:00— report_created — created