Files
aevolution/docs/adr/0014-message-bus.md
2026-10-08 12:08:53 -04:00

36 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[Reviewed]
# ADR-0014: Evaluate NATS JetStream
## Status
Proposed for M7–M8 asynchronous integration; no broker in proof.
## Context
History/region notifications may need durable fan-out; modular backend can start with direct calls/PostgreSQL.
## Decision
Evaluate JetStream first. Publish committed outbox IDs; consumers deduplicate transactionally and ACK after commit. Treat delivery as at least once at application boundary.
## Alternatives Considered
PostgreSQL outbox polling avoids service; NATS adds buffering/fan-out; Kafka partition/operations work lacks present evidence; Core NATS alone lacks durable replay.
## Benefits
Independent background consumers and backpressure.
## Costs
Retention/disk/broker upgrades/credentials/lag operations.
## Risks
Duplicate/reordered events, poison records, disk exhaustion, broker-as-truth and same-host replica loss.
## Consequences
Test restart/replay/redelivery/retention/poison handling. Required history stays in source of truth. Broker never grants ownership; DB fencing governs writes. Adopt only for measured need. [JetStream](https://docs.nats.io/concepts/jetstream), [server](https://github.com/nats-io/nats-server), [C client](https://github.com/nats-io/nats.c).