Data reading and writing method and device based on implementation of distributed consistency protocol

A protocol implementation, data reading and writing technology, applied in the field of data processing, can solve problems such as affecting reading performance and reading data overhead.

CN108234641AActive Publication Date: 2018-06-29北京奇元科技有限公司
8 Cites 23 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2018-06-29

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a data reading and writing method and a data reading and writing device based on the implementation of a distributed consistence protocol, computer equipment and a computer storage medium. The method comprises the steps of when any service node receives a data writing request sent by a first client, executing a data writing operation and updating a data version number recorded by the service node, and synchronizing data to be written to the other service nodes, and returning the data version number back to the first client; when any service node receives the data reading request carrying the first data version number sent by the second client, comparing the first data version number with the second data version number recorded by the service node, and responding tothe data reading request according to a comparison result. Therefore, the problem that in the prior art, when the data is read based on the distributed consistency protocol, the expense for reading the data is large due to the fact that more than half of the service nodes need to reach an agreement is solved.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of data processing, in particular to a data reading and writing method, device, computing device and computer storage medium realized based on a distributed consensus protocol. Background technique

[0002] A complete distributed system is formed by connecting many service nodes in different locations through the network, and a large amount of data is distributed among different service nodes in the entire network system. All clients connected to the distributed system can access the data in any service node.

[0003] The existing data reading method based on the distributed consensus protocol requires that each operation of reading data must follow the distributed consensus protocol (Raft protocol), that is, the service node that receives the data reading request sends the request through the network Send to other service nodes in the distributed system. After more than half of the service nodes in the dis...

Examples

Embodiment Construction

[0023] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0024] figure 1 A schematic flowchart of a method for reading and writing data based on a distributed consensus protocol is shown according to an embodiment of the present invention. This method is applied to a distributed system containing multiple service nodes, such as figure 1 As shown, the method includes the following steps:

[0025] Step S100, when any service node receives the data write request sent by the first client, ...