Distributed -Two-Phase Commit

Data System Architecture


The Two-Phase Commit is fairly standard for synchronous processing in order to avoid inconsistent state in a distributed environment.


1) User wants to Update; 2) Prepare; 3) Write to Log; 4) Ready; 5) Commit

First the User wants to Update, then the update is prepared, written to log, set to a ready state, and finally committed to the database.

Phase 1

  • Coordinator Sends “Prepare to Commit”
  • Subordinates make sure they can do so no matter what
  • Write the action to a log to tolerate failure
  • Subordinates Reply “Ready to Commit”

Phase 2

  • If all subordinates ready, send “Commit”
  • If anyone failed, send “Abort”

Documentation / Reference

Discover More
Data System Architecture
Distributed - Database / Application

Distributed systems is the opposite of a single node (ie computer). Scale across the system bus before you scale across the network with distributed systems. It is all the same design principles. Think...
Data System Architecture
Transaction - Commit

A commit preserve the changes by creating a new version of the data. See also: Two-phase_commit_protocol A commit occurs by appending a special record into the WAL. A commit request that the changes...

Share this page:
Follow us:
Task Runner