← 🤝 Distributed Systems

🤝 Two-Phase Commit: How Distributed Databases Agree to Commit or Abort Together

Phase:
Votes:
Drag — rotate · Scroll — zoom

🤝 Two-Phase Commit: How Distributed Databases Agree to Commit or Abort Together

This simulator visualizes the two-phase commit protocol in action, letting you watch prepare requests, votes, and final commit or abort decisions flow between a coordinator and its participants in real time.

🔬 What It Demonstrates

This simulator visualizes the two-phase commit protocol in action, letting you watch prepare requests, votes, and final commit or abort decisions flow between a coordinator and its participants in real time.

🎮 How to Use

Trigger a transaction, observe each participant's vote during the prepare phase, and then inject a coordinator crash at different points to see how the blocking problem leaves participants stuck holding their locks.

💡 Did You Know?

Many real-world distributed databases avoid pure two-phase commit for cross-node transactions specifically because of the blocking problem, preferring consensus-replicated coordinators or leaderless designs that tolerate node failures without freezing the whole cluster.