Professional Documents
Culture Documents
2 Phase Lockingvs 2 Phase Commit Protocol
2 Phase Lockingvs 2 Phase Commit Protocol
At the end of the transaction, the locks are released and number of locks held by the transactions
shrinks.
Since the locks are acquired in one phase and released in another phase i.e., there are no lock releases
in acquire phase and no new lock acquire in release phase, this is called 2 phase locking.
TLDR:
2 phase locking - for serializable isolation within a single database instance
2 phase commit - atomic commit across multiple nodes of a distributed database/datastores