Two-phase commit
A bank transfer takes money out of an account on one database and puts it into an account on another. If the first succeeds and the second fails, money vanishes. How do you make two machines commit together, or not at all?
In this lesson you'll learn to
- Explain the atomic commit problem across several databases or services.
- Walk through the prepare and commit phases of two-phase commit.
- Explain why two-phase commit blocks when the coordinator fails, and what that costs.
- Recognise where two-phase commit is used today, and when to avoid it.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.