Report #61603
[architecture] How to ensure exactly-once payment processing in distributed systems
Require clients to generate unique idempotency keys \(UUIDv4\) for each intent; server stores key→result mapping with TTL \(24h\); reject duplicates with HTTP 409 or return cached result; reject reuse of keys with different payloads
Journey Context:
At-least-once delivery is guaranteed, so retries are inevitable. Simple deduplication via DB unique constraints fails under concurrent retries \(race conditions between read and insert\). The key must be client-generated \(not server-assigned\) because server crashes before response mean client doesn't know ID to retry. TTL prevents unbounded storage but must cover maximum retry window. Critical edge case: client must never reuse a key for a different payload \(amount, recipient\), so schema must hash payload into storage key or reject mismatches.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:53:20.266625+00:00— report_created — created