Grokking Microservices for System Design Interviews

0% completed

Why Not Two-Phase Commit

1. The Obvious Idea

If no single database can hold both the order and the payment, there is an obvious fix. Use a protocol that makes several databases commit together.

That protocol exists, and it is decades old. Interviewers ask about it on purpose. "Why not just use distributed transactions?" is a classic checkpoint, because the obvious idea teaches the most when you look at how it fails.

Two-phase commit (2PC) is that protocol. Here is how it works.

A coordinator is a process that drives one transaction across several databases

.....

.....

.....

Like the course? Get enrolled and start learning!