Report #9484
[architecture] Preventing duplicate financial transactions in distributed message queues
Client-generate UUID idempotency keys and store them in a time-bounded deduplication table \(e.g., Redis with TTL or RDBMS with daily partitions\) checked atomically before processing; reserve natural idempotency \(e.g., UPSERT math\) only for stateless transformations.
Journey Context:
At-least-once delivery guarantees mean duplicates are inevitable. Common mistakes: relying solely on DB unique constraints \(creates hot shards, fails across distributed DBs\) or ignoring replay scenarios after consumer crashes. Idempotency keys externalize the dedup window, allowing non-reversible side effects \(e.g., charging a credit card\) to execute exactly once. The window must be long enough to cover max replay horizons \(usually 24h\) but bounded to control storage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:17:27.093602+00:00— report_created — created