HomeDistributed & Parallel ComputingTwo-Phase Commit: How Distributed Databases Agree to Commit or Abort Together

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

Explore the two-phase commit protocol that lets distributed databases guarantee atomicity across multiple nodes, and see why coordinator failure creates the infamous blocking problem.

Distributed & Parallel Computing3DModerate60 FPS
two-phase-commit-lab ↗ Open standalone

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.

⚙ Under the hood

Explore the two-phase commit protocol that lets distributed databases guarantee atomicity across multiple nodes, and see why coordinator failure creates the infamous blocking problem.

distributed-systemsdatabasestwo-phase-commitconsensustransactionspaxosraftfault-tolerance

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)