Glossary

Two-Phase Commit

Atomically commit across machines: prepare, then commit only if all agree.

1 min read·5 sections
Open the interactive version → diagrams, practice & more

Definition

Atomically commit across machines: prepare, then commit only if all agree.

How it works

Safe but blocks if the coordinator dies mid-commit. Modern systems run it over a consensus group (Spanner) to remove that single point of failure.

Learn more on SystemLore

Common questions

What is Two-Phase Commit?

Atomically commit across machines: prepare, then commit only if all agree.

How does Two-Phase Commit work?

Safe but blocks if the coordinator dies mid-commit. Modern systems run it over a consensus group (Spanner) to remove that single point of failure.

What is Two-Phase Commit used for in system design?

Safe but blocks if the coordinator dies mid-commit. Modern systems run it over a consensus group (Spanner) to remove that single point of failure.

Part of Glossary on SystemLore — system design explained with 148 deep topics, interactive diagrams, and a build-it-yourself game. Build this one →