Records Commit Before Their Reactions
Context
The approved change-event architecture separates a successful aggregate save from its projections and follow-on work. Database capture covers the record and children, while the queue owns delivery and retry.
Decision
Contact and organization aggregate writes commit with database-captured change events; independent handlers react after commit with at-least-once delivery; reconciliation handlers reread current data, while search forwards captured snapshots.
Alternatives Considered
Run every reaction inside the record transaction. That would expose ordinary saves to remote-service latency and unrelated handler failures.
Maintain a separate handwritten outbox topic for each reaction. The retired approach required repeated trigger and topic work and could omit a write path. Shared capture registers handlers independently.
Consequences
Each handler receives its own message. Failure in one projection does not rerun another successful handler or reverse the original save. Current-state reconciliation and snapshot indexing are different contracts, and the design identifies which one each handler uses.
A committed record can precede updated compliance, region or search results. Failed handler deliveries reach a dead-letter queue after five receives without a record-screen notification. Reconciliation owns current-state repair, while Platform owns stale or repeated search-snapshot handling.