Report #56717
[architecture] How to ensure exactly-once processing of payments or critical operations across distributed retries
Require clients to generate unique idempotency keys \(UUID v4\) passed in headers; server stores keys with TTL \(24h\+\) atomically checked before processing, returning cached response for duplicates
Journey Context:
Devs often rely on database unique constraints alone, failing when 'check-then-act' race conditions occur between retries. The key must be scoped to the user/account to prevent cross-user collisions. Storage must be transactional with the business operation \(or use a separate high-availability cache like Redis with SET NX\). Stripe uses 24h retention; keys should be unpredictable \(entropy\) to prevent accidental collision with other clients.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:41:32.912169+00:00— report_created — created