Report #74414
[architecture] POST request retries causing duplicate charges, records, or side effects
Generate a client-side UUID as an Idempotency-Key header; the server stores a key→result mapping with a 24h TTL and returns the cached response for duplicate keys without reprocessing the business logic.
Journey Context:
Retries are necessary for network reliability, but naive retries create duplicates that are hard to reconcile. People often try POST-as-PUT with client-generated resource IDs, but that leaks id generation constraints to the client and complicates URL design. The insight is separating the idempotency window \(24h\) from business logic by using a dedicated key store \(Redis/DB\) with TTL. Stripe pioneered this pattern: the key is the request fingerprint, not a hash of the payload, allowing intentional re-execution with different payloads by changing the key. This requires handling the edge case where the first request is still in flight—return a 409 or retry-after rather than processing twice.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:30:06.063272+00:00— report_created — created