Dynamic check method and device for consistency of main and salve databases

A master database and dynamic verification technology, applied in the Internet field, can solve problems such as inaccurate consistency verification results, achieve the effects of realizing processing capacity, shortening verification time, and improving verification accuracy

Active Publication Date: 2014-12-31
ADVANCED NEW TECH CO LTD
View PDF4 Cites 40 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0013] This application provides a dynamic verification method and device for the consistency of master-slave databases, to at least solve the technical problem of inaccura

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Dynamic check method and device for consistency of main and salve databases
  • Dynamic check method and device for consistency of main and salve databases
  • Dynamic check method and device for consistency of main and salve databases

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0046] Example 1

[0047] figure 2 It is a preferred structural schematic diagram of a dynamic verification device for the consistency of a master-slave database according to an embodiment of the present application. Preferably, the system in this embodiment may be located on the server 102.

[0048] The inventive concept of this preferred embodiment may mainly include: initializing the difference primary key list; performing a predetermined number of update operations on the difference primary key list; after completing the predetermined number of update operations, if the difference primary key list is still not empty, it indicates the difference The database of the master-slave database corresponding to the primary key list is inconsistent. Wherein, the difference primary key list retains the primary keys corresponding to the data with differences between the primary database and the secondary database determined after the comparison is completed.

[0049] Preferably, in order t...

Example Embodiment

[0086] Example 2

[0087] in Figure 2-Figure 4 On the basis of the system shown, this application provides a preferred dynamic verification method for the consistency of the master-slave database. Such as Figure 5 As shown, the method may include the following steps:

[0088] Step S502: Repeat the following steps N times, where N is a preset natural number: retrieve the database record corresponding to the primary key in the difference primary key list from the primary database to obtain the primary database record set; retrieve and retrieve from the secondary database Database records corresponding to the primary keys in the difference primary key list to obtain a slave database record set; acquire the primary keys corresponding to the database records that have differences between the master database record set and the slave database record set, and compare the difference primary key list The primary key in is updated to the primary key corresponding to the database record wi...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a dynamic check method and device for the consistency of main and salve databases. The method comprises the steps of repeatedly executing the following steps for N times, wherein N is a preset natural number: retrieving a database record corresponding to a main key in a difference main key list from the main database to obtain a main database record set; retrieving a database record corresponding to a main key in the difference main key list from a slave database to obtain a slave database record set; obtaining the main keys corresponding to the database records with difference in the main database record set and the slave database record set, updating the main keys in the difference main key list as the main keys corresponding to the database records with the differences; after the steps are executed for N times, if the main key still exists in the difference main key list, judging the inconsistency of the main database and the salve database, otherwise, judging the consistency of the main database and the slave database. The dynamic check method and device for the consistency of the main and salve databases solves the technical problem of inaccurate consistency check result caused by the synchronous delay in related art is solved.

Description

technical field [0001] The present application relates to the field of the Internet, in particular, to a method and device for dynamically verifying the consistency of master-slave databases. Background technique [0002] MySQL is an open source database software widely used in the Internet industry. Many large websites are using MySQL databases. With the continuous growth of business scale, it is difficult for a MySQL database to support a huge amount of data access. [0003] At present, a more effective solution is to establish a MySQL master-slave cluster, in which the slave database (also known as the standby database or standby database) is a complete mirror image of the master database (also known as the master database). Write requests are only performed on the main database, and read requests are evenly distributed to all databases, so that the entire database cluster can provide larger-capacity read and write services. If the MySQL master database receives new or ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30G06F11/00
CPCG06F11/004G06F16/275
Inventor 叶晖俊
Owner ADVANCED NEW TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products