beginnerTwo-Phase Commit (2PC)

What are the two phases in Two-Phase Commit?

Prepare (vote) and Commit/Abort (decide) — nothing is actually committed until every participant has voted yes.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What happens to a participant that voted YES if the coordinator crashes before phase 2?← Back to all Transaction Mastery questions