Dual write vs outbox
A dual write saves the row and then sends the event as a second step, so a failure between the steps loses or delays the event. An outbox saves the event in the same transaction, and a relay sends it. When the read view stops for 5 s, the dual write leaves 39,155 mismatched reads. The outbox passes.
Outbox · 10 orders · 10 events · 0 lost
13 deliveries · 10 payments applied · 0 charged twice
Case 1
The order database takes 250 commits/s for 40 s. Its read view stops from 0:15 to 0:20. Mismatched reads must stay below 1,000 and update age below 8 s.
| Measure | Goal | Dual write | Transactional outbox |
|---|---|---|---|
| Data mismatches (Reads) | under 1,000 | 39,155 Fail | 599 Pass |
| Data age | under 8 s | 79.9 s Fail | 5.2 s Pass |
| Monthly cost | 24 USD/mo | 24 USD/mo | |
| p99 latency | 23 ms | 23 ms | |
| Error rate | 6.3% | 6.3% |