feat: outbox pattern for reliable integrations #235
Labels
No labels
bug
documentation
enhancement
investigation
nice-to-have
performance
production-ready
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ash/eskit#235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When an event is appended and an external side effect is needed (webhook, email, payment API), there is no transactional guarantee. The event may be stored but the side effect lost (crash between append and HTTP call), or vice versa.
Automations help but they replay on crash — causing duplicate side effects unless the external system is idempotent.
Solution
Outbox pattern: store events + outbox entry in the same DB transaction. A background relay reads the outbox and delivers to external systems.
Components:
OutboxWriter— called within Append transactionOutboxRelay— background goroutine, polls outbox, delivers, marks doneWithOutbox(dest, filter)— option on store to auto-populate outboxSupported for pgstore and sqlitestore (same DB transaction guarantee).
Pillar: Security (no lost events), Developer Experience