Tencent / phxpaxos

The Paxos library implemented in C++ that has been used in the WeChat production environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

和Raft实现有啥区别吗?

tsyw1987 opened this issue · comments

Paxos和Raft在理论上就有不少区别。如果都按经典论文实现的话

  1. Raft是串行的,Paxos是并行的。当然PhxPaxos采用了串行的方式
  2. Raft必须有严格的leader保证正确性,而Paxos只需要宽松的leader提升性能。所以Paxos是可以多leader写的。这也导致Paxos的可用性比Raft高,因为在Raft中,leader挂了后,需要重新选举,这需要时间

这么说吧,Paxos is more general. We can say Raft is a special case of Paxos.

如果一定要说区别,最大的区别是这个,Paxos Log可以不连续,Raft Log一定要连续。这也决定了实现的时候Raft要简单很多:)