What is 2 phase commit?- Distributed transactions are performed by relational databases.
- To ensure each and every transaction to perform in an orderly manner, a process is implemented. This process is called Two Phase Commit.
- In this process, the transactions termination occurs either by committing or rolling back them.
- It is a type of atomic commitment protocol.
- It achieves its goals even in the temporary system failures that is why they are used widely.
It consists of two phases:
1. commit request phase: Here the coordinator process prepares all the transaction participating processes to take the necessary steps for committing or aborting the transaction.
2. commit phase: It is based on the voting of the cohorts where the coordinator decides whether to commit or abort the transaction and notify the results to the cohorts. They will follow the required actions with local transactional resources and their respective portions in the transaction's other output.
|