Report #74269
[architecture] Handling duplicate API requests safely without double-charging or double-processing
Require clients to send an Idempotency-Key header \(UUID\) on mutation requests; server stores key\+response for 24h and replays stored response on duplicate
Journey Context:
POST retries from mobile apps on flaky networks cause duplicates that unique DB constraints cannot catch \(e.g., partial updates\). The Stripe pattern uses client-generated UUIDs stored temporarily in Redis or DB with TTL. Tradeoff: requires storage but enables horizontal scaling. Common mistakes: server generating keys \(defeats purpose\), using timestamps \(clock skew\), or not atomically checking\+inserting \(race conditions\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:15:37.976920+00:00— report_created — created