Three Phase Commit

Pasted image 20230920124708.png

An improved version of Two Phase Commit which added another steps called "can commit" steps which typically do health check and so on before running the Two Phase Commit

  1. Can commit: coordinator ping all the services to check if they're healthy to commit
  2. Prepare phase: services prepare to commit, lock the database to prepare to commit and so on
  3. Commit phase: services started to commit. If all commits then it stays commits. If one fails then coordinator will ask all services to rollback

However, in this case we still have the coordinator as Single point of failure