System Design Patterns: From Fundamentals to Real Systems
0% completed
Two-Phase Commit
1. The Incident
The store adds gift-card transfers between customers. Customer A, stored on shard 2, sends $50 to customer B on shard 5. The sharding lesson's warning now applies because one logical operation changes two databases without one transaction covering both.
The first implementation subtracts 50 from shard 2 and then adds 50 to shard 5. Thousands of transfers complete successfully through these two sequential writes.
At 2:37 AM, the application server stops after committing the subtraction but before sending the addition
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%