# Outbox Pattern

Record: `arch:outbox-pattern`
Kind: pattern
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: recommended
Scope: persistence, messaging
Canonical: https://banes-lab.com/ontology#arch-outbox-pattern

## Repair

- Refactored by: Add Outbox Table, Add Relay Worker
- Detected by: dual-write patterns
- Violated by: database write followed by direct publish without atomicity
- Measured by: lost-message rate, outbox coverage
- Enforced by: persistence rules, integration tests

## requires

- [Local Transaction](https://banes-lab.com/records/lex/local-transaction.md)
- [Message Relay](https://banes-lab.com/records/lex/message-relay.md)

## reinforces

- [Event Reliability](https://banes-lab.com/records/lex/event-reliability.md)

## enables

- [Atomic State Change + Message Publish](https://banes-lab.com/records/lex/atomic-state-change-message-publish.md)

## conflicts-with

- [Dual Write](https://banes-lab.com/records/arch/dual-write.md)

## tensions-with

- [Relay Complexity](https://banes-lab.com/records/lex/relay-complexity.md)

## tensions

- [Outbox Pattern Relay Complexity](https://banes-lab.com/records/tension/outbox-pattern-relay-complexity.md)
