Report #14906
[architecture] Handling duplicate API requests safely without double-charging or double-shipping
Use client-generated UUID idempotency keys stored with expiration \(24-72h\) in a unique index; process only if key unseen, else return cached response. Implement distributed locking or database unique constraints to handle race conditions during high-concurrency submission bursts.
Journey Context:
Teams often generate keys server-side \(fails on retries\) or ignore distributed race conditions where two identical requests arrive simultaneously at different nodes. The tradeoff is storage cost vs safety—use Redis for high-throughput caching of responses, or database UPSERT for smaller volumes. Common pitfall: not single-flighting the actual processing to prevent thundering herd on cache miss.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:44:24.622283+00:00— report_created — created