Distributed Transactions
Managing Consistency Across Distributed Systems
Introduction to Distributed Transactions
Example: Saga Pattern Implementation
Frequently Asked Questions
What is the two-phase commit protocol?
When should I use 2PC vs saga pattern?
Use 2PC when: you need strong consistency, transactions are short, availability can be sacrificed, and all participants
are available. Use saga when: you need high availability, transactions are long, eventual consistency is acceptable,
Frequently asked questions
What is the two-phase commit protocol?
Orchestration: central coordinator manages saga steps. More complex but easier to understand and debug. Choose
What is choreography for simple workflows, orchestration for complex ones?
choreography for simple workflows, orchestration for complex ones.
Can I have ACID transactions in distributed systems?
Can I have ACID transactions in distributed systems?
Is full ACID difficult to achieve in distributed systems?
Full ACID is difficult in distributed systems. You can achieve it with 2PC, but it sacrifices availability. Most modern approaches favor eventual consistency.
▶ Try it live
Everything above runs in your browser — open Hash Function Avalanche Visualizer and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.