Two-Phase Commit (2PC) is a distributed consensus protocol that guarantees atomicity for a transaction across multiple, independent participants by ensuring all either commit to the changes or all abort, preventing partial updates. It achieves this through a coordinator that manages a two-phase process: a voting phase where participants prepare, and a decision phase where the coordinator instructs them to commit or rollback based on unanimous readiness. This protocol is a cornerstone for providing ACID transaction properties in distributed databases and multi-agent systems where operations span several nodes.
