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

1.2 KiB
Raw Permalink Blame History

[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, server, C client.