vpp-ai-platform/docs/adr/0004-postgres-outbox-before-kafka.md
stewart hu 80835138e9 Scaffold repo for implementation handoff
- README: orientation, doc map, target package layout (pointers only,
  no duplicated architecture content)
- CLAUDE.md: agent operating manual — invariants as code-review rules,
  conventions, do-not list, task reading order
- ROADMAP: M1-M5 with verifiable acceptance criteria, phase-2 fence
- GLOSSARY: canonical Chinese-term → code-name mapping
- docs/adr/: eight ADRs recording settled decisions and rejected
  alternatives
- docs/open-questions.md: consolidated TODO(业务) tracker by owner and
  blocking milestone
- .gitignore; untrack .DS_Store

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019u5SLNweVio6ozJX7yfxQr

🔮 View transcript: https://logs.lojong.info/s/e8u90k3t33w590r7b5y7yzqh
2026-09-01 21:13:00 -04:00

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.