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. "Why not just use distributed transactions?" is worth answering carefully, 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!
Reading Progress
0%