concept Raft in category hyperledger

This is an excerpt from Manning's book Programming Hyperledger Fabric: Creating Permissioned Blockchains.
The ordering service is nothing but a pubsub (short for publish-subscribe) system if you are familiar with them. There are many open source off-the-shelf pubsub systems available such as Apache Kafka and RabbitMQ. Prior to version 1.4, Fabric used Kafka. Version 1.4 added Raft as the recommended option.
There is nothing special about how consensus is achieved in Fabric. It is simply a consequence of all stakeholders agreeing to a change before its committed onto the ledger. Raft is nothing but a protocol used by the etcddatabase in which the ordering service stores its data. Andetcdis a general purpose database not unique to Fabric. It is used by other projects as well such as Kubernetes.
The only advantage or feature enhancement provided by Kafka over the Solo orderer is protection against a single point of failure, known in other words as Crash Fault Tolerance (CFT). Raft adds the ability to form a decentralized ordering service.
In the context of Fabric’s ordering service, Zab and Raft are CFT protocols in which the constituent nodes vote to elect one node as leader. The leader node then processes all transactions submitted by client applications. If the leader node goes down (i.e., crashes), a new node is elected leader and continues processing of transactions. The followers blindly trust the order of transactions that is output by the leader node. That’s all there is to it. There is no message passing and voting to come to any consensus amongst the nodes about the transactions. The only time there is a consensus is when the leader has to be elected. So much so for calling themselves a consensus protocol!
The Raft based ordering service stores its data in a database known as
etcd. From its online documentation:84 “etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines”. The Raft protocol is simply the engine that powers this database and synchronizes the state of the key-value store across the machines.Etcdis not unique to Fabric. It is a general purpose key-value store also used by other projects such as Kubernetes. What does the key-value store store? In case of Fabric, this key-value store is storing(block_id, block). It will also order transactions on first-come-first-served basis. A Raft cluster ofnnodes can handle maximumMath.floor((n-1)/2)failures before the consistency guarantee across nodes starts to break. This translates to 1 failure for 3 nodes, or 2 failures for 5 nodes, or 3 failures for 7 nodes. Most common configuration for Raft is 3, 5, or 7 nodes. The Raft consensus algorithm is also used by Docker swarm by the way to keep the nodes in a swarm synchronized w.r.t. the global cluster state. Raft is named after Reliable, Replicated, Redundant, And Fault-Tolerant.Table 2. 9 is a summary of the most noticeable feature enhancements or improvements in Fabric ranging from
1.xto current stable release of2.0in my opinion. If you ask me, version 1.4 is the MVP (minimally viable product) for Fabric because with version 1.3 or less the ordering service is under control of a single organization and thus the network is not fully decentralized. This is because the Kafka cluster of Zookeeper nodes can only be managed by a single org. And not to mention the fact that it takes significant operational expertise to setup, configure, and manage a Kafka cluster. 85 With v1.3, sometimes the peer orgs hire a 3rd party company to manage the ordering service and lose out on the whole value proposition of blockchain in the first place which is about reducing costs and decentralization! Another business model is to form an independent company with the peer orgs as shareholders. With 1.4 and Raft, the ordering service can be finally decentralized and peer orgs can contribute nodes to it. Version 1.4 still has one major bug in it which is that the endorsement policy is specified by the administrator of some organization and other organizations just have to trust that it was correctly set. So even calling 1.4 as a MVP is somewhat of a stretch.