Why architecture matters here
2PC failures come from coordinator blocking + slow recovery. Architecture matters because the blocking case is what makes 2PC unpopular.
The architecture: every piece explained
The top strip is protocol. Coordinator. Prepare phase. Participants. Commit phase.
The middle row is safety. Coordinator log. Blocking on coordinator failure. Recovery / heuristics. Latency + availability tradeoffs.
The lower rows are practice. Alternatives. Use where fit. Ops — timeouts + drills.
End-to-end flow
End-to-end: coordinator sends prepare to 3 participants. All vote yes. Coordinator writes commit decision to log. Broadcasts commit. All participants ack. Compare failure case: coordinator crashes after logging but before broadcasting; on restart, replay log and resend commit. If log lost, participants stay in-doubt.