Report #71319
[architecture] Implementing idempotent API endpoints without global key collisions or indefinite storage bloat
Scope idempotency keys per-user \(or per-account\), not globally; store them for 24h minimum to match longest retry windows; return HTTP 409 Conflict with the existing resource location on replay, never 500.
Journey Context:
Global keys create accidental collisions across unrelated users; storing forever causes unbounded DB growth; returning 500 on replay breaks client retry loops. The 24h TTL aligns with payment gateway windows \(Stripe uses 24h\). Per-user scoping prevents cross-tenant data leakage while maintaining isolation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:17:21.178728+00:00— report_created — created