All challenges
advancedReal-World Systems~55 min

Two-Phase Commit (2PC)

Make several databases agree to commit — or none of them do. Implement the classic atomic-commit protocol: participants vote in a prepare phase, a coordinator decides commit only if every vote is yes, and the decision is driven home in a second phase. Build the voting participant, the coordinator's all-or-nothing rule, the full protocol, and the abort path. The consensus behind distributed transactions in Postgres XA, MySQL, and sharded stores.