Context
Traditional messaging systems often rely on background reconciliation workers or transactional protocols to enforce exactly-once delivery.
These mechanisms introduce coordination dependencies and operational complexity.
BSFG requires duplicate suppression during replay without requiring active reconciliation processes.
Decision
Idempotency is enforced at the Forward Buffer storage interface via an atomic operation:
putIfAbsent(idempotencyKey, payload)
Duplicate detection is based on a stable idempotency key:
- default: content hash of payload
- optional: canonicalized hash
- optional: producer-provided event ID
The storage layer must guarantee atomic insertion per key.
Consequences
Benefits:
- duplicate suppression without background workers
- replay safety after crashes or partitions
- simple replication loops
Tradeoffs:
- storage systems must support atomic conditional writes
- idempotency key design must be stable across retries