jackyfkc.github.io

教土豆学计算机

Raft

Raft is a consensus algorithm that is designed to be easy to understand.

Raft 是一个一致性算法, 同 (multi-)Paxos 做同样的事情; 但它设计的更易理解, 更易于实现.

以下节选自 Diego Ongaro 的一封邮件, 其中解释了 Raft 这个名字的来源

There’s a few reasons we came up with the name Raft:

Raft Basics

Raft implements consensus by first electing a server as leader, then giving the leader complete responsibility for managing the replicated log.

The leader accepts log entries from clients, replicates them on other servers, and tells servers when it is safe to apply log entries to their state machines. Having a leader simplifies the management of the replicated log.

Raft divides time into terms of arbitrary length. Each term begins with an election.

Server State Machine


Raft 通过将问题分解成若干个子问题来解决



Implementations

Further Readings