CN106777321A - Using the method and device of KV database realizing data consistencies - Google Patents

Using the method and device of KV database realizing data consistencies Download PDF

Info

Publication number
CN106777321A
CN106777321A CN201710011484.3A CN201710011484A CN106777321A CN 106777321 A CN106777321 A CN 106777321A CN 201710011484 A CN201710011484 A CN 201710011484A CN 106777321 A CN106777321 A CN 106777321A
Authority
CN
China
Prior art keywords
record
node
databases
initial request
utilization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710011484.3A
Other languages
Chinese (zh)
Inventor
臧琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710011484.3A priority Critical patent/CN106777321A/en
Publication of CN106777321A publication Critical patent/CN106777321A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The present invention relates to distributed storage software technology field, a kind of method of utilization KV database realizing data consistencies is disclosed, including:Initiate to access record request to KV databases;If to the service end node for finally changing the record, state-of-the-art record is sent to initial request node to KV data base queryings by above-mentioned service end node, if initial request node changes the record, using amended record as state-of-the-art record;If inquiry is less than KV databases generate the record, and the record is sent into initial request node.The invention also discloses a kind of device of utilization KV database realizing data consistencies, including:Access record request initiation module, record acquisition module, record generation module and record modification module.The present invention can solve the problems, such as to take massive band width when the inconsistent data between distributed node and synchrodata.

Description

Using the method and device of KV database realizing data consistencies
Technical field
It is more particularly to a kind of using KV database realizings data one the present invention relates to distributed storage software technology field The method and device of cause property.
Background technology
Distributed data base refers to multiple database servers of the dispersion positioned at identical or different place, and cooperation is common to be completed The data storage and calculation function of one big data base management system.We using distributed storage service when, in cluster File-sharing service is provided in the presence of multiple nodes, each node connects different clients, and different clients may be to phase Same file is operated, when service end is operated according to client instructions to file, it is necessary to preserve some file attributes With the information such as client operation, it is necessary to store in database, some data need to be synchronized between different service ends, Ensure the uniformity of data, so being accomplished by a kind of distributed data base.
At present, there are many database service nodes in cluster, when increase a data record, database service node it Between the communication that is carried out for synchronous this data record it is very many, this obstruction for resulting in internal network or delay, product The more interactive information of life, influence the stability and bandwidth of internal network, and extra increased each database of guarantee clothes The treatment logic that business node can store this data record can also take extra resource.
The content of the invention
It is an object of the present invention to provide a kind of method and device of utilization KV database realizing data consistencies, the present invention is main For the distributed data base that distributed storage service end is used, the database is a kind of KV databases of lightweight, can be solved Data certainly between distributed node are inconsistent and the problem of massive band width is taken during synchrodata.
To achieve these goals, the present invention uses following technical scheme:
A kind of method of utilization KV database realizing data consistencies, comprises the following steps:
Initiate to access record request to KV databases;
If KV data base queryings are to the service end node for finally changing the record, be sent to for state-of-the-art record by above-mentioned service end node Initial request node, if initial request node changes the record, using amended record as state-of-the-art record;If inquiry is not Arrive, KV databases generate the record, and the record is sent into initial request node.
Preferably, KV databases include that Key and Value, wherein Value include Head and Value ', and note is stored in Head The host node ID and latest data node ID of record.
Preferably, if KV data base queryings are to the service end node for finally changing the record, above-mentioned service end node will most New record is sent to initial request node, specifically includes:
KV database roots are calculated the host node ID of the record according to Key;
By the latest data node ID synchronized update of the record to KV databases;
State-of-the-art record is sent to initial request node by latest data node.
Preferably, host node ID is calculated by Key using hash algorithm.
Preferably, if initial request node changes the record, using amended record as state-of-the-art record, further Including:If initial request node changes the record, initial request node ID is revised as latest data node ID.
This law invention also provides a kind of device of utilization KV database realizing data consistencies, including:
Record request initiation module is accessed, for initiating to access record request to KV databases;
Record acquisition module, initial request node is sent to for latest data node by state-of-the-art record;
Record generation module, generates for KV databases and records;
Record modification module, records for changing, using amended record as state-of-the-art record.
Preferably, also include:Host node ID computing modules, for being calculated host node using hash algorithm by Key ID。
Compared with prior art, the present invention has advantages below:
1. be stored with the host node ID and latest data node ID of record in the Head of lightweight KV databases of the present invention, host node It is to store the record and the service end node being currently running in cluster, latest data node is the service end for finally changing the record Node, when certain client is initiated to access record request, by the host node ID and latest data node ID of the record, Ke Yicha State-of-the-art record is found, it is achieved thereby that the record in multiple service end nodes is state-of-the-art record, makes the record in different services Synchronized between end node, it is ensured that the uniformity of data.
2. in order to overcome for a synchronous record between database service node, and cause what internal network blocked to lack Fall into, the present invention finds latest data node by host node ID and latest data node ID in KV databases, obtain this note The state-of-the-art record of record, realizes the synchronization of data, so as to ensure that the stability of network and optimize bandwidth.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of the method for utilization KV database realizing data consistencies of the invention;
Fig. 2 is a kind of structural representation of the device of utilization KV database realizing data consistencies of the invention.
Specific embodiment
In order to make it easy to understand, the part noun to occurring in the present invention makees explanation explained below:
KV databases, key assignments(Key-value, KV)Database stores number by this mappings of one value of a key correspondence According to, so that KV databases are more suitable for non-structured data, and user can define the semanteme of value data storages with oneself Information, therefore KV databases have high ease for use, and be very easy to be extended system.
With reference to the accompanying drawings and examples, specific embodiment of the invention is described in further detail:
The present embodiment provides a kind of method of utilization KV database realizing data consistencies, comprises the following steps:
Initiate to access record request to KV databases;
If KV data base queryings are to the service end node for finally changing the record, be sent to for state-of-the-art record by above-mentioned service end node Initial request node, if initial request node changes the record, using amended record as state-of-the-art record;If inquiry is not Arrive, KV databases generate the record, and the record is sent into initial request node.
Fig. 1 is refer to, Fig. 1 is that a kind of flow of the method for utilization KV database realizing data consistencies of the invention is illustrated Figure;The present embodiment provides a kind of method of utilization KV database realizing data consistencies, comprises the following steps:
Step S101, client is initiated to access record request to KV databases.
Wherein, KV databases include Key and Value, are retrieved by Key, it is ensured that uniqueness, find Value and right Value is operated, and wherein Value includes Head and Value ', the host node ID and latest data section of stored record in Head Point ID, host node ID are calculated by Key using hash algorithm.Host node is to store the record in cluster and be currently running Service end node, latest data node is the service end node for finally changing the record.
Step S102, if the host node ID that KV data base queryings are recorded to this, searches this and records by host node ID Latest data node ID, state-of-the-art record is sent to initial request node by latest data node.If initial request node The record is changed, then changes the Head parts in the Value stored in current primary node and latest data node KV databases, will Initial request node ID is revised as latest data node ID.
If recorded less than this by KV database lookups, the KV databases generate the record, and the record is sent Give initial request node.
Host node ID and latest data node ID that the present invention passes through stored record in KV databases, search latest data section Point, the data for making each client be obtained from latest data node are the data of recent renewal, so as to ensure that the one of data Cause property;In order to avoid the communication carried out for a synchronous record between multiple database service nodes is very more, cause interior The problem of portion's network congestion, the present invention passes through above KV databases, it is only necessary to search latest data node, obtains state-of-the-art record, Such record changes, without, about the service end node database synchronized update of this record, being optimized in cluster Bandwidth, it is ensured that the stability of internal network.
Fig. 2 is refer to, Fig. 2 is a kind of structural representation of the device of utilization KV database realizing data consistencies of the invention Figure;The present embodiment provides a kind of device of utilization KV database realizing data consistencies, including:Access record request initiation module 21st, record acquisition module 22, record generation module 23, record modification module 24 and host node ID computing modules 25, wherein accessing Record request initiation module 21 connects with host node ID computing modules 25, record acquisition module 22 and record modification module 24 successively Connect, record generation module 23 is connected in parallel with record acquisition module 22, record modification module 24.
Record request initiation module 21 is accessed, for initiating to access record request to KV databases;Record acquisition module 22, State-of-the-art record is sent to initial request node for latest data node;Record generation module 23, for the generation of KV databases Record;Record modification module 24, records for changing, using amended record as state-of-the-art record;Host node ID computing modules 25, for being calculated host node ID using hash algorithm by Key.
Illustrated above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (7)

1. a kind of method of utilization KV database realizing data consistencies, it is characterised in that comprise the following steps:
Initiate to access record request to KV databases;
If KV data base queryings are to the service end node for finally changing the record, be sent to for state-of-the-art record by above-mentioned service end node Initial request node, if initial request node changes the record, using amended record as state-of-the-art record;If inquiry is not Arrive, KV databases generate the record, and the record is sent into initial request node.
2. the method for utilization KV database realizing data consistencies according to claim 1, it is characterised in that KV databases Including Key and Value, wherein Value includes Head and Value ', the host node ID and latest data section of stored record in Head Point ID.
3. the method for utilization KV database realizing data consistencies according to claim 2, it is characterised in that
If KV data base queryings are to the service end node for finally changing the record, be sent to for state-of-the-art record by above-mentioned service end node Initial request node, specifically includes:
KV database roots are calculated the host node ID of the record according to Key;
By the latest data node ID synchronized update of the record to KV databases;
State-of-the-art record is sent to initial request node by latest data node.
4. the method for utilization KV database realizing data consistencies according to claim 3, it is characterised in that
Host node ID is calculated by Key using hash algorithm.
5. the method for utilization KV database realizing data consistencies according to claim 2, it is characterised in that
If initial request node changes the record, using amended record as state-of-the-art record, further include:If most First requesting node changes the record, then initial request node ID is revised as into latest data node ID.
6. a kind of device of utilization KV database realizing data consistencies, it is characterised in that including:
Record request initiation module is accessed, for initiating to access record request to KV databases;
Record acquisition module, initial request node is sent to for latest data node by state-of-the-art record;
Record generation module, generates for KV databases and records;
Record modification module, records for changing, using amended record as state-of-the-art record.
7. the device of utilization KV database realizing data consistencies according to claim 6, it is characterised in that also include:
Host node ID computing modules, for being calculated host node ID using hash algorithm by Key.
CN201710011484.3A 2017-01-07 2017-01-07 Using the method and device of KV database realizing data consistencies Pending CN106777321A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710011484.3A CN106777321A (en) 2017-01-07 2017-01-07 Using the method and device of KV database realizing data consistencies

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710011484.3A CN106777321A (en) 2017-01-07 2017-01-07 Using the method and device of KV database realizing data consistencies

Publications (1)

Publication Number Publication Date
CN106777321A true CN106777321A (en) 2017-05-31

Family

ID=58950128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710011484.3A Pending CN106777321A (en) 2017-01-07 2017-01-07 Using the method and device of KV database realizing data consistencies

Country Status (1)

Country Link
CN (1) CN106777321A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1480859A (en) * 2002-09-03 2004-03-10 鸿富锦精密工业(深圳)有限公司 Synchronous system in distributed files and method
CN101409665A (en) * 2007-10-08 2009-04-15 华为技术有限公司 Method and apparatus for processing P2P network node route
CN101635741A (en) * 2009-08-27 2010-01-27 中国科学院计算技术研究所 Method and system thereof for inquiring recourses in distributed network
CN103678572A (en) * 2013-12-09 2014-03-26 中国科学院计算机网络信息中心 Method and system for searching for Internet of Things information based on two layers of DHTs

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1480859A (en) * 2002-09-03 2004-03-10 鸿富锦精密工业(深圳)有限公司 Synchronous system in distributed files and method
CN101409665A (en) * 2007-10-08 2009-04-15 华为技术有限公司 Method and apparatus for processing P2P network node route
CN101635741A (en) * 2009-08-27 2010-01-27 中国科学院计算技术研究所 Method and system thereof for inquiring recourses in distributed network
CN103678572A (en) * 2013-12-09 2014-03-26 中国科学院计算机网络信息中心 Method and system for searching for Internet of Things information based on two layers of DHTs

Similar Documents

Publication Publication Date Title
Zheng et al. An innovative IPFS-based storage model for blockchain
WO2021032138A1 (en) Consensus method and device based on blockchain system, and system
JP6004299B2 (en) Method and apparatus for matching flow tables and switch
US8463850B1 (en) System and method of algorithmically generating a server side transaction identifier
CN102006330B (en) Distributed cache system, data caching method and inquiring method of cache data
CN105959433B (en) A kind of domain name analytic method and its domain name analysis system
Tang et al. QoS-aware replica placement for content distribution
WO2018000993A1 (en) Distributed storage method and system
US8805984B2 (en) Multi-operational transactional access of in-memory data grids in a client-server environment
US10534776B2 (en) Proximity grids for an in-memory data grid
US10257255B2 (en) Hierarchical organization for scale-out cluster
CN103905572B (en) The processing method and processing device of domain name mapping request
CN109542613A (en) Distribution method, device and the storage medium of service dispatch in a kind of CDN node
TWI734744B (en) Method, device and system for synchronizing routing table
CN110336843A (en) A kind of content distribution method, central node and fringe node for crowdsourcing
CN106055587A (en) Partitioning database system and routing method thereof
CN104717314B (en) A kind of IP management method and system, client, server
US10956501B2 (en) Network-wide, location-independent object identifiers for high-performance distributed graph databases
US20140025723A1 (en) Cloud storage system and data storage and sharing method based on the system
US8539041B2 (en) Method, apparatus, and network system for acquiring content
CN103761102B (en) A kind of uniform data service platform and its implementation
WO2013010432A1 (en) Method, node and system for data storage and query in peer network
CN108282525A (en) Video resource based on peer-to-peer network manages system and method
CN108574666A (en) A kind of data stream scheduling method, device and system
WO2009006779A1 (en) Method and system for determining user home index node and home service node

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170531

RJ01 Rejection of invention patent application after publication