Kafka and raft consensus mechanism

Time:2022-7-25

id:BSN_2021

Official account: BSN Institute

The two are different.

In the Kafka consensus model, orderer and orderer do not directly establish a connection with each other, but connect with Kafka. In this consensus mode, it depends on external Kafka cluster system and zookeeper cluster system.

Each orderer will send its own transactions to the Kafka cluster. After the transactions are sorted in the topic corresponding to Kafka, Kafka will push the sorted transactions to the orderer node. After receiving the transaction, the orderer node packages the transaction and sends it to peer

In raft consensus mode, the connection between orderer and orderer is established directly and does not depend on external systems. In the orderer node, a raft collaboration will be created to handle the communication with other orderers.

A raft cluster is composed of a master node and several follower nodes. After receiving the message, the master node copies it to other (follower) nodes. After receiving the message, the other (follower) nodes write the transaction in the log and feed back the results to the master node. When the master node receives enough feedback, it is considered as a valid transaction, otherwise it is an invalid transaction. The master node is generated by each node through voting. If one of the following nodes is disconnected, it will be re elected.

Currently, the fabric framework of BSN uses Kafka consensus, and there can only be one kind of consensus in the same blockchain network (fabric network).

Recommended Today

JS generate guid method

JS generate guid method https://blog.csdn.net/Alive_tree/article/details/87942348 Globally unique identification(GUID) is an algorithm generatedBinaryCount Reg128 bitsNumber ofidentifier , GUID is mainly used in networks or systems with multiple nodes and computers. Ideally, any computational geometry computer cluster will not generate two identical guids, and the total number of guids is2^128In theory, it is difficult to make two […]