Two-Phase and Three-Phase Commit¶
Atomic commit gives several participants one durable decision, at the cost of coordination and blocking.
flowchart LR
J[Junior: why atomic commit] --> M[Middle: prepare and decide] --> S[Senior: in-doubt failures] --> P[Professional: scale and recovery]
flowchart LR
Coordinator --> Prepare --> Participants --> Decision[Commit or abort]
| Level | Guide | You are done when |
|---|---|---|
| Junior | Definition and why | You can explain why sequential commits fail. |
| Middle | How it works | You can trace durable prepare and decision ordering. |
| Senior | Failures and mistakes | You can resolve in-doubt transactions safely. |
| Professional | Best practices and scale | You can govern atomic commit at scale. |
Practice rule: After prepare, never guess the global decision from a timeout.