16 lines
692 B
Markdown
16 lines
692 B
Markdown
|
|
# ADR-0004: Postgres transactional outbox first, Kafka later
|
||
|
|
|
||
|
|
**Status**: accepted · 2026-09
|
||
|
|
|
||
|
|
**Context**: Event bus carries business objects (P4) and is the audit backbone
|
||
|
|
(P5). Phase-1 volume is bid-frequency, not telemetry-frequency.
|
||
|
|
|
||
|
|
**Decision**: Phase 1 uses a Postgres transactional outbox (business write +
|
||
|
|
event in one transaction) with polling/LISTEN consumers, behind a thin bus
|
||
|
|
interface. Phase 2 relays the outbox into Kafka when telemetry-scale events
|
||
|
|
arrive; consumer interface unchanged.
|
||
|
|
|
||
|
|
**Consequences**: Exactly-once-ish semantics via same-DB transactionality in
|
||
|
|
phase 1; events reconcile trivially against business data. Bus abstraction must
|
||
|
|
not leak Postgres specifics.
|