Have You Deliberately Decided Whether You Need Distributed Transactions?¶
Type: DeepDive
Category: Data
Audience: Engineers dealing with microservices, cross-DB workflows, or async state
đ First, the Meta-Question¶
Distributed transactions arenât always needed.
But they always need to be considered.
If you skipped the question,
youâve made a decisionâjust not consciously.
- Will the system be OK if two updates succeed, and the third fails?
- Is eventual consistency acceptable here?
- Who detects and repairs drifted state?
- Whatâs the user experience in partial success cases?
â ď¸ When It Goes Wrong¶
- Partial updates that look fine⌠until a user clicks âexportâ
- Async retries that reapply incomplete state
- Background jobs cleaning up state that was never finalized
- System tests that donât simulate failure modes
â Healthier Patterns¶
- Explicit modeling of consistency boundaries
- Choose per-case: local txn / saga / outbox / retry-compensate
- Store enough metadata to debug failure reconstruction
- Document what it means for consistency to âeventuallyâ happen
đ§ Core Philosophy¶
Youâre not designing for âno failures.â
Youâre designing for who pays the cost of failureâand when.
â FAQ¶
-
Q: Isnât this infra stuff?
A: Only if your domain doesnât care about truth. -
Q: But we donât need 2PC, right?
A: Probably not. But have you designed around its absence?