Report #5151
[architecture] How to prevent duplicate processing when API requests are retried due to network timeouts
Require clients to generate UUID idempotency keys for mutation requests; store keys with TTL \(24h\+\) and check before processing. Atomically store the response alongside the key so retries return cached result without re-executing business logic.
Journey Context:
Developers often use request body hashes as keys, which break when clients add optional fields or change JSON key ordering. Others implement idempotency checks but re-execute side effects on cache miss race conditions. The critical insight is that the idempotency store update and the business transaction must be atomic \(e.g., same SQL transaction or DynamoDB transaction write\). Stripe uses 24-hour key retention; keys should be client-generated UUIDs, not server-generated, to allow safe retry across client sessions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:44:38.240821+00:00— report_created — created