Report #71571
[architecture] Handling duplicate API requests safely
Use the Idempotency-Key HTTP header \(UUID\) with server-side deduplication storage \(Redis/DB\) holding the response for a TTL matching the client's retry window \(e.g., 24h\). Return the stored response for duplicate keys, do not re-process.
Journey Context:
Developers often generate unique request IDs but miss that network timeouts cause retries where the original request actually succeeded, leading to double charges or writes. Simply checking for key existence is insufficient—you must cache the response to return to the client. Tradeoff: storage cost vs exactly-once semantics. Alternatives like database unique constraints fail for distributed systems across regions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:42:41.921874+00:00— report_created — created