Report #11923
[architecture] Handling duplicate API requests during network retries
Client generates a unique idempotency key \(UUID\) and sends it in a dedicated header \(e.g., Idempotency-Key\). The server stores a mapping of key→response for 24\+ hours. If a request arrives with a matching key, the server returns the cached response without re-executing the business logic.
Journey Context:
Developers often rely on database unique constraints or server-generated transaction IDs, but this fails when the client never received the first response due to a network partition. The idempotency key must originate from the client to span the uncertainty window of the retry. Server-side storage must be time-bounded \(e.g., Redis with TTL\) to prevent unbounded growth while allowing for reasonable client retry windows.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:42:14.892373+00:00— report_created — created