如果你从事服务端开发,在互联网规模越来越大的今天,你或多或少会接触一些“分布式”相关的东西,而共识算法作为分布式系统的基石,却不是那么容易理解和实现的。paxos 论文晦涩难懂,raft 在具体实现上也有很多细节值得考究。本文收集了一些关于分布式共识算法的资料,中英文都有,愿你 from zero to hero。
“一致性”这个词已经越来越被滥用了,你经常可以在各种博客看到把 paxos 写做是一种“分布式一致性算法”,但 paxos 明确的写着“The Consensus Algorithm”是一种共识算法。阅读: 被误用的“一致性”
理论基础
- 维基百科对“共识”的解释: Wikipedia: Consensus
- 分布式系统中的时序:Time, Clocks, and the Ordering of Events in a Distributed System
- 拜占庭将军问题:Byzantine Generals
Paxos 算法
- Paxos 共识算法论文:Paxos made Simple
- Paxos 的中英文维基都是很好的学习材料:Wikipedia: Paxos
- Raft 作者讲解 Paxos:Paxos lecture (Raft user study)
- Paxos 的原论文:The Part-time Parliament
- Paxos made code: Implementing a high throughput Atomic Broadcast
Paxos 工程实现
- 微信基于 Paxos 的高可用、强一致存储:PaxosStore: High-availability Storage Made Practical in WeChat
- 微信的另一个 Paxos 实现:Tencent/phxpaxos
- ScalienDB: Designing and Implementing a Distributed Database using Paxos
- 500 lines or less: Clustering by Consensus
- Using Paxos to Build a Scalable, Consistent, and Highly Available Datastore
Paxos 变体
- CASPaxos: Replicated State Machines without logs
- Fast Paxos
- Flexible Paxos: Quorum Intersection Revisited
- Stoppable Paxos
- Disk Paxos
Raft 算法
- Raft 官网:The Raft Consensus Algorithm
- Raft 论文:Raft: In Search of an Understandable Consensus Algorithm
- Raft 作者讲解 Raft:Raft lecture (Raft user study)
Raft 工程实现
- etcd
- consul
Chubby
- Chubby 论文:The Chubby Lock Service for Loosely-Coupled Distributed Systems
- Chubby 视频讲解:Camille Fournier on The Chubby lock service for loosely-coupled distributed systems
ZooKeeper
- Zab 论文:Zab: A Simple Totally Ordered Broadcast Protocol
- Zab 的工程实现 ZooKeeper:ZooKeeper: Wait-free coordination for Internet-scale systems
Viewstamped Replication
- Viewstamped Replication: A New Primary Copy Method to Support Highly-Available Distributed Systems
- Viewstamped Replication Revisited
- From Viewstamped Replication to Byzantine Fault Tolerance
其它
- 共识算法简史:A brief history of Consensus, 2PC and Transaction Commit
- Paxos vs Raft: Have we reached consensus on distributed consensus?
- An introduction to distributed systems
- Lessons Learned from Implementing Paxos
持续更新……
多学习、成长的内容,欢迎关注我的公众号:
![2cdb554e4c8e6afdc4c8846e9eae037f.png](https://img-blog.csdnimg.cn/img_convert/2cdb554e4c8e6afdc4c8846e9eae037f.png)