Idempotent billing ledger
Duplicate webhooks, concurrent updates and reconciliation gaps.
Webhook → Go transaction → PostgreSQL journal + outbox → event delivery
Design and validation
Enforce durable idempotency and balanced postings inside the database transaction. Retry serialization failures and reconcile external side effects. Redis coordination is optional, never the source of financial correctness.
Replay duplicate events; interrupt commits; verify conservation, retry behavior and reconciliation against a defined dataset.