architecture 1 min read

Day 9 of #DistributedDilemmas: Distributed transactions are a myth at scale

Distributed transactions are a myth at scale. Two-phase commit falls apart under network partitions. Design for compensation, not for distributed…

Two-phase commit falls apart under network partitions. Design for compensation, not for distributed atomicity.

2PC’s (2 Phase Commit) Fundamental Limitations:
When coordinator-participant communication fails after prepare phase, 2PC enters indefinite blocking where participants can’t safely commit/abort without coordinator. This creates the “cask effect” where one failure paralyzes the whole system. https://cs.stackexchange.com/questions/76192/why-is-two-phase-commit-2pc-blocking


Alibaba__Cloud ‘s distributed transaction solution uses Saga(Compensation Pattern) to handle cross-service payments:

  1. Order service creates order record
  2. Payment service deducts funds
  3. Notification service sends receipt

If any step fails:

  1. Payment Service → Reverse deduction
  2. Order Service → Mark order failed
  3. Notification → Cancel pending emails

https://www.alibabacloud.com/blog/an-in-depth-analysis-of-distributed-transaction-solutions_597232

Day 9 diagram: Distributed transactions are a myth at scale

Day 9 on X ↗

Leave a comment

Keep reading