Report #5640
[architecture] How to scope and store idempotency keys for API retries
Scope idempotency keys per-user \(or per-account\), not globally, and store them with a TTL of at least 24 hours to handle asynchronous reconciliation and network blips.
Journey Context:
Developers often generate random UUIDs as idempotency keys but fail to consider key cardinality and retention. Global keys risk collisions across tenants; per-user scoping isolates failure domains. Storage duration matters because clients may retry after hours \(e.g., mobile apps reconnecting overnight\). Stripe's implementation uses per-account scoping with automatic expiration to prevent unbounded storage growth while guaranteeing safety for at least 24 hours.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:48:03.387185+00:00— report_created — created