Paxos vs two phase commit

前端 未结 2 725
别那么骄傲
别那么骄傲 2021-01-30 16:42

I am trying to understand the difference between paxos and two phase commit as means to reach consensus among multiple machines. Two phase commit and three phase commit is very

2条回答
  •  Happy的楠姐
    2021-01-30 17:31

    2PC blocks if the transaction manager fails, requiring human intervention to restart. 3PC algorithms (there are several such algorithms) try to fix 2PC by electing a new transaction manager when the original manager fails.

    Paxos does not block as long as a majority of processes (managers) are correct. Paxos actually solves the more general problem of consensus, hence, it can be used to implement transaction commit as well. In comparison to 2PC it requires more messages, but it is resilient to manager failures. In comparison to most 3PC algorithms, Paxos renders a simpler, more efficient algorithm (minimal message delay), and has been proved to be correct.

    Gray and Lamport compare 2PC and Paxos in an excellent paper titled "Consensus on Transaction Commit".

    (In the answer of peter, I think he is mixing 2PC with 2PL (two-phase locking).)

提交回复
热议问题