CN115080661A - Database synchronization method, device, management and control platform and system - Google Patents

Database synchronization method, device, management and control platform and system Download PDF

Info

Publication number
CN115080661A
CN115080661A CN202210680110.1A CN202210680110A CN115080661A CN 115080661 A CN115080661 A CN 115080661A CN 202210680110 A CN202210680110 A CN 202210680110A CN 115080661 A CN115080661 A CN 115080661A
Authority
CN
China
Prior art keywords
database
group
slave
master
response
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
CN202210680110.1A
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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202210680110.1A priority Critical patent/CN115080661A/en
Publication of CN115080661A publication Critical patent/CN115080661A/en
Pending legal-status Critical Current

Links

Images

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a database synchronization method, a database synchronization device, a database management and control platform and a database management and control system, and relates to the field of data processing. The method adopts a group-response scheme, namely after the transaction received by the master database is synchronized to each slave database, the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group, and the synchronizing device in the master database can continue the next transaction. The method and the system can ensure the consistency and the high performance of the database and also ensure the stability of the database.

Description

Database synchronization method, device, management and control platform and system
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a database synchronization method, apparatus, management and control platform, and system.
Background
MySQL is a relational database, and in the aspect of WEB application, MySQL is the most widely used database in the market at present. In the field of distributed databases built by MySQL currently, it is a core problem to ensure consistency among multiple copies of the same data scattered on multiple nodes.
In the related art, techniques such as asynchronous replication, full synchronous replication, and semi-synchronous replication are used to achieve database synchronization. Asynchronous replication means that the master database writes a transaction Binlog (binary log) event into a Binlog file, at this time, the master database only notifies a Dump (backup file system) thread to send the new Binlog, and then the master database continues to process the commit operation. Fully synchronous replication means that after the master database commits transactions, all slave database nodes must receive and commit the transactions, and after all slave nodes are synchronized, the master database thread can continue to perform subsequent operations after ACK (acknowledgement character) is completed in the master database. The semi-synchronous replication is one between full synchronous replication and asynchronous replication, the master database only needs to wait for at least one slave database node to receive and Flush (refresh) Binlog to Relay Log files, and the master database can execute subsequent operations without waiting for all slave databases to respond to the master database.
Disclosure of Invention
The technical problem to be solved by the present disclosure is to provide a database synchronization method, apparatus, management and control platform and system, which can ensure the consistency and high performance of the database and ensure the stability of the database.
According to an aspect of the present disclosure, a database synchronization method performed by a database synchronization apparatus is provided, the method including: when the database in which the database synchronization device is located is in a master database mode, synchronizing the transaction received by the master database to each slave database of each database group in a plurality of database groups; judging whether the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group; and executing the corresponding service under the condition that the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group.
In some embodiments, when the database in which the database synchronization apparatus is located is switched from the slave database mode to the master database mode, the transaction submitted by the server is received, and the transaction is synchronized to each slave database.
In some embodiments, the receiving server is stopped from receiving the committed transaction when the database in which the database synchronization apparatus is located switches from the master database mode to the slave database mode.
In some embodiments, the response threshold for each database group is determined based on at least one of network conditions and traffic demands.
According to another aspect of the present disclosure, there is also provided a database synchronization apparatus, including: a transaction synchronization unit configured to synchronize a transaction received by the master database to each slave database of each of the plurality of database groups; the response judging unit is configured to judge whether the number of the slave databases receiving the response from the master database in each database group meets a response threshold set by the corresponding database group; and the service execution unit is configured to execute the corresponding service under the condition that the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group.
According to another aspect of the present disclosure, there is also provided a database synchronization apparatus, including: a memory; and a processor coupled to the memory, the processor configured to perform the database synchronization method as described above based on instructions stored in the memory.
According to another aspect of the present disclosure, a database synchronization method performed by a database management and control platform is further provided, where the method includes: grouping the plurality of slave databases to obtain a plurality of database groups; and setting a configuration table in the database, wherein the configuration table comprises member information of each database group in a plurality of database groups and a response threshold of each database group, the database synchronization device in the master database synchronizes the received transaction to each slave database according to the configuration table, and executes corresponding services under the condition that the number of the slave databases receiving responses from the master database in each database group meets the response threshold set by the corresponding database group.
In some embodiments, in the event of a failure of the master database, selecting a switch object in the slave database as the master database; and updating the number of members in the database group containing the switching object in the configuration table.
In some embodiments, in the event of one or more slave database failures, the number of members in the database group containing the failed slave database in the configuration table is updated.
In some embodiments, it is determined whether the response threshold of the corresponding database group needs to be adjusted according to the adjusted number of members in each database group.
In some embodiments, the response threshold for each database group is determined based on at least one of network conditions and traffic demands.
According to another aspect of the present disclosure, a database management and control platform is further provided, including: the database management unit is configured to group a plurality of slave databases to obtain a plurality of database groups; and a configuration table setting unit configured to set a configuration table in the database, the configuration table including member information of each database group in the plurality of database groups and a response threshold of each database group, wherein the database synchronization device of the master database synchronizes the received transaction to each slave database according to the configuration table, and executes the corresponding service in a case that the number of the slave databases receiving the response from the master database in each database group satisfies the response threshold set by the corresponding database group.
According to another aspect of the present disclosure, a database management and control platform is further provided, including: a memory; and a processor coupled to the memory, the processor configured to perform the database synchronization method as described above based on instructions stored in the memory.
According to another aspect of the present disclosure, there is also provided a database management system, including: the above-mentioned database synchronizer; and the database management and control platform.
According to another aspect of the present disclosure, a non-transitory computer-readable storage medium is also presented, having stored thereon computer program instructions, which when executed by a processor, implement the database synchronization method described above.
In the embodiment of the disclosure, a group-response scheme is adopted, that is, after the transactions received by the master database are synchronized to each slave database, the number of slave databases receiving responses in the master database in each database group meets the response threshold set by the corresponding database group, and the synchronization device in the master database can continue the next transaction, so that the consistency and high performance of the databases are ensured, and the stability of the databases is also ensured.
Other features of the present disclosure and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a schematic flow chart diagram of some embodiments of a database synchronization method of the present disclosure;
FIG. 2 is a schematic diagram of database synchronization in some embodiments of the present disclosure;
FIG. 3 is a schematic flow chart diagram illustrating further embodiments of a database synchronization method according to the present disclosure;
FIG. 4 is a schematic block diagram of some embodiments of a database synchronization apparatus of the present disclosure;
FIG. 5 is a schematic diagram illustrating an alternate embodiment of a database synchronization apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of some embodiments of a database management platform of the present disclosure; and
fig. 7 is a schematic structural diagram of another embodiment of a database management platform according to the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be discussed further in subsequent figures.
For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.
In the related art, the asynchronous replication technology can improve the performance of the database, but cannot provide the consistency of the database. The fully synchronous replication technique can improve the consistency of the database, but completely abandons the performance of the database. The semi-synchronous replication technology is a compromise scheme between the asynchronous replication technology and the fully synchronous replication technology, but the stability of a database in the technology is poor.
In the financial industry, the requirements on the consistency, stability, high performance and the like of a database are very strict, the high performance of the database, the consistency of the database and the stability of the database are ensured, and therefore the database synchronization method, the database synchronization device, the database management and control platform and the database management and control system are provided.
Fig. 1 is a flow diagram of some embodiments of a database synchronization method of the present disclosure. The method is executed by a database synchronization device, the database synchronization device is located in a database, and when the database in which the database synchronization device is located is in a primary database mode, the method includes step 110-.
At step 110, transactions received by the master database are synchronized to each slave database of each of the plurality of database groups.
In some embodiments, the database is a relational database, such as a MySQL database.
In some embodiments, in a distributed cluster, an instance node responsible for providing a data writing service is a master database instance, an instance node capable of providing only a data reading service is a slave database instance, and there may be a plurality of slave database instances in the cluster. The master database instance receives a write data request sent by a client, converts the write data request into log data in a specific format, sends the log data to the slave database instance, and executes the write request locally through the log data by the slave database instance to finally achieve the consistency with the data of the master database instance.
In some embodiments, the database management platform groups a plurality of slave databases to obtain a plurality of database groups, and sets a configuration table in the databases, where the configuration table includes member information of each database group in the plurality of database groups, and a response threshold of each database group, that is, the number of slave databases that the master database needs to receive a response in each database group.
As shown in FIG. 2, the slave databases 1-9 are divided into 3 groups, the slave databases 1 and 2 being the first group, the slave databases 3-5 being the second group, and the slave databases 6-9 being the third group. The response threshold of the first group is 1, the response threshold of the second group is 1, and the response threshold of the third group is 2.
In step 120, it is determined whether the number of slave databases in each database group to which the master database receives a response satisfies a response threshold set for the corresponding database group.
In some embodiments, after the master database instance sends the log data to the slave database instance, the slave database instance replies to the master database instance with confirmation that the log data has been received.
In step 130, in the case that the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group, the corresponding service is executed.
In some embodiments, after each database group responds with Acknowledgements (ACKs) to the master database by a predetermined amount, the synchronizer in the master database may continue with the next transaction without regard to the response acknowledgement status of slave databases that have not yet replicated the master database data. For example, in the case where the number of slave database responses to acknowledge to the master database in the first group and the second group satisfies 1, and the number of slave database responses to acknowledge to the master database in the third group satisfies 2, the synchronizer in the master database may continue with the next transaction.
In the above embodiment, a group-response scheme is adopted, that is, after the transactions received by the master database are synchronized to each slave database, the number of slave databases receiving responses from the master database in each database group meets the response threshold set for the corresponding database group, and the synchronization device in the master database can continue the next transaction, so that the consistency and high performance of the databases are ensured, and the stability of the databases is also ensured.
In some embodiments of the present disclosure, when the database in which the database synchronization apparatus is located is switched from the slave database mode to the master database mode, a transaction submitted by the server is received, and the transaction is synchronized to each slave database.
In other embodiments, the transaction committed by the receiving server is stopped when the database in which the database synchronization apparatus is located switches from the master database mode to the slave database mode.
For example, when the original master database fails, the database management platform selects a switching object from the database as the master database, and the switching object is used as a new master database to execute the function of the original master database, and the original master database does not receive the transaction submitted by the server any more.
In the above embodiments, the group-response technique is able to run smoothly throughout the life of the database.
Fig. 3 is a schematic flow chart diagram illustrating further embodiments of a database synchronization method according to the present disclosure. This embodiment is performed by a database administration platform.
At step 310, a plurality of slave databases are grouped to obtain a plurality of database groups.
For databases in the financial industry, various highly available schemes are generally adopted, such as local master-slave standby libraries, remote machine rooms with real-time standby libraries and the like. In some embodiments, the slave databases are grouped on the basis of ensuring that enough slave databases can synchronize the data of the master database in a minimum time.
In step 320, a configuration table is set in the database, the configuration table includes member information of each database group in the plurality of database groups and a response threshold of each database group, wherein the database synchronization device of the master database synchronizes the received transaction to each slave database according to the configuration table, and executes the corresponding service when the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group.
In some embodiments, the response threshold for each database group is determined based on at least one of network conditions and traffic demands. For example, if a fast response is required, the number is set to be small, and if it is to be ensured that the data is relatively high in security, the number is set to be large.
In some embodiments, the database management platform sets a unique identification id for each database instance, so as to facilitate management of the database instances. For example, as shown in FIG. 2, the slave database id is 1, the slave database id is 2 …, the slave database id is 9, and the master database id is 10. The database cluster is divided into 3 groups, and the configuration table group _ ack field of the database behind the database management platform is shown in table 1.
TABLE 1
Figure BDA0003698017490000081
In the configuration table, ID is a self-increment ID field and a unique primary key of the table; cluster _ id is a certain database cluster to which the group belongs; ins _ ids is the set of database instances that the set contains in common. If the value of the second group in the configuration table is "3,4,5", it indicates that the slave databases 3,4,5 belong to the same group in the database instance; need _ num is the number of ACK needed by the group to the main database, and the value ranges from 0 to-1 of the total number of examples in the group.
In some embodiments, metadata information for each database group is also stored in the configuration table, such as the role of master and slave libraries, mount point changes for vips, backup policy changes, switch log information, and the like.
In some embodiments, each managed database instance has a configuration table, e.g., mysql group ack, built into it, with values stored in the table, e.g., "1|1, 2; 1|3,4, 5; 1|6,7,8,9 ". "; "means that two groups are divided, for example, 9 slave databases in fig. 2, and can be divided into 4 groups at most. "|" indicates the number of intra-group ACKs and group members within a split packet, with "|" preceded by the number of intra-group ACKs and "|" followed by the group members. As shown in FIG. 2, the legal value of the number of ACKs in a group is 0 at the minimum and-1 at the maximum. "," indicates individual members within the segmented group, wherein the number of members per group does not require consistency.
In the above embodiment, the database management and control platform divides the slave databases into a plurality of database groups, and sets a configuration table for the data set, where the configuration table includes member information of each database group and a response threshold of each database group, so that the master database executes corresponding services when receiving the number of the slave databases sending responses in each database group and meeting the response threshold set for the corresponding database group, thereby ensuring consistency, stability and high performance of the databases.
In some embodiments of the present disclosure, the database management platform selects a switching object as a master database from the slave databases in case of a failure of the master database, updates the number of members in a database group including the switching object in the configuration table, and sets the configuration table in the master database switched to be new.
In some embodiments, after the failed master database is restored to the normal state, the database management and control platform may select the database as the master database again, restore the switched object as the slave database to the original database group, and update the configuration table again, that is, add 1 to the number of members in the database group including the switched object.
In some embodiments, it is determined whether the response threshold of the corresponding database group needs to be adjusted based on the adjusted number of members in each database group.
For example, when the master database 10 fails, if the slave database 3 in the second group is a switching target and becomes a new master database, the database management platform automatically changes the metadata information of the platform and writes the value "1|1, 2" into the slave database 3; 1|4, 5; 2|6,7,8,9 ". I.e. the membership information of the second group is modified but the response threshold of the second group is not modified.
For example, when the master database 10 fails, if the slave database 1 in the first group is a switching target and becomes a new master database, the database management platform automatically changes the metadata information of the platform and writes the value of "0| 2" into the slave database 1; 1|3,4, 5; 2|6,7,8,9 ". I.e. the membership information of the first group is changed while the response threshold of the first group is changed. Since only one slave database 2 is left in the first group, if the slave database 2 also needs to respond, the performance of the whole system is possibly lowered, and the overall performance of the database cluster can be improved by changing the response threshold of the database group.
And the new synchronization device in the master database synchronizes the received transaction to each slave database according to the updated configuration table, and executes the corresponding service under the condition that the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group.
In other embodiments of the present disclosure, in the case of one or more slave database failures, the database management and control platform updates the number of members in the database group including the failed slave database in the configuration table.
In some embodiments, it is determined whether the response threshold of the corresponding database group needs to be adjusted according to the adjusted number of members in each database group.
For example, if the slave database 7 in the third group fails, the master database does not need to switch operations, and the database management and control platform automatically changes the metadata information of the platform and writes the value to the master database 10 as "1|1, 2; 1|3,4, 5; 2|6,8,9 ". I.e. the member information of the third group is modified but the response threshold of the third group is not modified.
For another example, if the slave database 2 in the first group fails, the master database does not need to switch operations, and the database management and control platform automatically changes the metadata information of the platform and writes the value to the master database 10 to be "0| 1; 1|3,4, 5; 2|6,7,8,9 ". I.e. the membership information of the first group is changed while the response threshold of the first group is changed. Since only one member slave database 1 is left in the first group, if the slave database 1 also needs to respond, the performance of the whole system is possibly lowered, and the overall performance of the database cluster can be improved by changing the response threshold of the database group.
And the synchronization device in the master database synchronizes the received transaction to each slave database according to the updated configuration table, and executes the corresponding service under the condition that the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group.
In the embodiment, the group-response technology runs stably in the whole life cycle of the database, and even when a database cluster fails, new groups can be automatically adjusted according to the independent logic design of the back end, so that the automatic operation and maintenance capability is realized.
Fig. 4 is a schematic structural diagram of some embodiments of a database synchronization apparatus according to the present disclosure. The synchronization apparatus includes a transaction synchronization unit 410, a response judgment unit 420, and a service execution unit 430.
The transaction synchronization unit 410 is configured to synchronize transactions received by the master database to each slave database of each of the plurality of database groups.
In some embodiments, the database management platform groups the slave databases and sets a configuration table in the database, wherein the configuration table comprises member information and a response threshold of each database group. The transaction synchronization unit 410 synchronizes the received transaction to each slave database according to the configuration table.
In some embodiments, when the database in which the database synchronization apparatus is located is switched from the slave database mode to the master database mode, the transaction submitted by the server is received, and the transaction is synchronized to each slave database.
In some embodiments, the transaction committed by the receiving server is stopped when the database in which the database synchronization apparatus is located is switched from the master database mode to the slave database mode.
The response determining unit 420 is configured to determine whether the number of slave databases receiving a response from the master database in each database group satisfies a response threshold set for the corresponding database group.
In some embodiments, the response threshold for each database group is determined based on at least one of network conditions and traffic demands.
The service execution unit 430 is configured to execute the corresponding service if the number of the slave databases, which receive the response from the master database in each database group, meets the response threshold set by the corresponding database group.
In the above embodiment, a group-response scheme is adopted, that is, after the transactions received by the master database are synchronized to each slave database, the number of slave databases receiving responses from the master database in each database group meets the response threshold set for the corresponding database group, and the synchronization device in the master database can continue the next transaction, so that the consistency and high performance of the databases are ensured, and the stability of the databases is also ensured.
Fig. 5 is a schematic structural diagram of another embodiment of a database synchronization apparatus according to the present disclosure. The synchronization apparatus 500 includes a memory 510 and a processor 520. Wherein: the memory 510 may be a magnetic disk, flash memory, or any other non-volatile storage medium. The memory 510 is used for storing instructions in the embodiment corresponding to fig. 1. Processor 520 is coupled to memory 510 and may be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 520 is configured to execute instructions stored in memory.
In some embodiments, processor 520 is coupled to memory 510 by a BUS BUS 530. The synchronization apparatus 500 may also be connected to an external storage system 550 through a storage interface 540 for calling external data, and may also be connected to a network or another computer system (not shown) through a network interface 560. And will not be described in detail herein.
In the embodiment, the data instructions are stored in the memory and processed by the processor, so that the consistency and high performance of the database are ensured, and the stability of the database is also ensured.
Fig. 6 is a schematic structural diagram of some embodiments of a database management platform of the present disclosure. The administration platform includes a database management unit 610 and a configuration table setting unit 620.
The database management unit 610 is configured to group the plurality of slave databases, resulting in a plurality of database groups.
In some embodiments, the slave databases are grouped and divided on the basis of ensuring that enough slave databases can synchronize the data of the master database in the shortest time
The configuration table setting unit 620 is configured to set a configuration table in the database, where the configuration table includes member information of each database group in the plurality of database groups and a response threshold of each database group, and the database synchronization apparatus of the master database synchronizes the received transaction to each slave database according to the configuration table, and executes the corresponding service in a case where the number of slave databases receiving a response from the master database in each database group satisfies the response threshold set by the corresponding database group.
In some embodiments, the response threshold for each database group is determined based on at least one of network conditions and traffic demands.
In some embodiments, the database management unit 610 is further configured to select a switch object as a master database from the slave database in case of a failure of the master database, and the configuration table setting unit 620 is further configured to update the number of members in the database group including the switch object in the configuration table.
In some embodiments, the configuration table setting unit 620 is further configured to update the number of members in the database group of the configuration table containing the failed slave database in the case of one or more slave database failures.
In some embodiments, the configuration table setting unit 620 is further configured to determine whether the response threshold of the corresponding database group needs to be adjusted according to the adjusted number of members in each database group.
In the embodiment, when the database cluster fails, the management platform can automatically adjust the new groups and the response threshold in each group, so that the group-response technology can be stably applied to the whole life cycle of the database, and the database synchronization safety is improved.
Fig. 7 is a schematic structural diagram of another embodiment of a database management platform according to the present disclosure. The governing platform 700 includes a memory 710 and a processor 720. Wherein: the memory 710 may be a magnetic disk, flash memory, or any other non-volatile storage medium. The memory 710 is used for storing instructions in the embodiment corresponding to fig. 3. Processor 720, coupled to memory 710, may be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 720 is configured to execute instructions stored in the memory.
In some embodiments, processor 720 is coupled to memory 710 through a BUS BUS 730. The hosting platform 700 may also be connected to an external storage system 750 through a storage interface 740 for invoking external data, and may also be connected to a network or another computer system (not shown) through a network interface 760. And will not be described in detail herein.
In the embodiment, the data instruction is stored by the memory and processed by the processor, so that the consistency and high performance of the database are ensured, and the stability of the database is also ensured.
In other embodiments of the present disclosure, a database management and control system is further protected, and the database management and control system includes the database synchronization device in the above embodiment and the database management and control platform in the above embodiment.
In further embodiments, a computer-readable storage medium has stored thereon computer program instructions which, when executed by a processor, implement the steps of the method in the embodiments corresponding to fig. 1 and 3. As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, apparatus, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Thus far, the present disclosure has been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.
Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the foregoing examples are for purposes of illustration only and are not intended to limit the scope of the present disclosure. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims (15)

1. A database synchronization method performed by a database synchronization apparatus, the method comprising:
when the database where the database synchronization device is located is in a master database mode, synchronizing the transaction received by the master database to each slave database of each database group in a plurality of database groups;
judging whether the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group; and
and executing corresponding services under the condition that the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group.
2. The database synchronization method of claim 1, further comprising:
when the database where the database synchronization device is located is switched from the slave database mode to the master database mode, the transaction submitted by the server is received, and the transaction is synchronized to each slave database.
3. The database synchronization method of claim 1, further comprising:
and when the database where the database synchronization device is located is switched from the master database mode to the slave database mode, stopping receiving the transaction submitted by the server.
4. The database synchronization method according to any one of claims 1 to 3,
the response threshold for each database group is determined based on at least one of network conditions and traffic demands.
5. A database synchronization apparatus, comprising:
a transaction synchronization unit configured to synchronize a transaction received by the master database to each slave database of each of the plurality of database groups;
the response judging unit is configured to judge whether the number of the slave databases receiving the response from the master database in each database group meets a response threshold set by the corresponding database group; and
and the service execution unit is configured to execute the corresponding service under the condition that the number of the slave databases receiving the response from the master database in each database group meets the response threshold set by the corresponding database group.
6. A database synchronization apparatus, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the database synchronization method of any of claims 1-4 based on instructions stored in the memory.
7. A database synchronization method performed by a database management platform, the method comprising:
grouping the plurality of slave databases to obtain a plurality of database groups; and
setting a configuration table in a database, wherein the configuration table comprises member information of each database group in the plurality of database groups and a response threshold of each database group, and the response threshold of each database group is set,
and the database synchronization device in the master database synchronizes the received transaction to each slave database according to the configuration table, and executes corresponding services under the condition that the number of the slave databases receiving responses from the master database in each database group meets the response threshold set by the corresponding database group.
8. The database synchronization method of claim 7, further comprising:
selecting a switching object as a master database in a slave database in case of a failure of the master database; and
and updating the number of members in the database group containing the switching object in the configuration table.
9. The database synchronization method of claim 7, further comprising:
and in the case of one or more slave database faults, updating the number of members in the database group containing the fault slave database in the configuration table.
10. The database synchronization method according to claim 8 or 9,
and determining whether the response threshold of the corresponding database group needs to be adjusted or not according to the number of the members in each adjusted database group.
11. The database synchronization method according to any one of claims 7 to 9,
and determining the response threshold of each database group according to at least one of network conditions and service requirements.
12. A database management and control platform, comprising:
the database management unit is configured to group a plurality of slave databases to obtain a plurality of database groups; and
a configuration table setting unit configured to set the configuration table in a database, the configuration table including member information of each of the plurality of database groups and a response threshold of each database group, wherein,
and the database synchronization device of the master database synchronizes the received transaction to each slave database according to the configuration table, and executes corresponding service under the condition that the number of the slave databases receiving response from the master database in each database group meets the response threshold set by the corresponding database group.
13. A database management and control platform, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the database synchronization method of any of claims 7 to 11 based on instructions stored in the memory.
14. A database management system comprising:
the database synchronization apparatus of claim 5 or 6; and
the database management platform of claim 12 or 13.
15. A non-transitory computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the database synchronization method of any of claims 1 to 4, 7 to 11.
CN202210680110.1A 2022-06-16 2022-06-16 Database synchronization method, device, management and control platform and system Pending CN115080661A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210680110.1A CN115080661A (en) 2022-06-16 2022-06-16 Database synchronization method, device, management and control platform and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210680110.1A CN115080661A (en) 2022-06-16 2022-06-16 Database synchronization method, device, management and control platform and system

Publications (1)

Publication Number Publication Date
CN115080661A true CN115080661A (en) 2022-09-20

Family

ID=83254550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210680110.1A Pending CN115080661A (en) 2022-06-16 2022-06-16 Database synchronization method, device, management and control platform and system

Country Status (1)

Country Link
CN (1) CN115080661A (en)

Similar Documents

Publication Publication Date Title
US11360854B2 (en) Storage cluster configuration change method, storage cluster, and computer system
WO2019154394A1 (en) Distributed database cluster system, data synchronization method and storage medium
WO2018103318A1 (en) Distributed transaction handling method and system
JP4461147B2 (en) Cluster database using remote data mirroring
US20120254342A1 (en) Method for Providing Access to Data Items from a Distributed Storage System
CN102938705B (en) Method for managing and switching high availability multi-machine backup routing table
CN105930498A (en) Distributed database management method and system
CN105069152B (en) data processing method and device
US9348841B2 (en) Transaction processing method and system
WO2016018262A1 (en) Storage transactions
CN115794499B (en) Method and system for dual-activity replication data among distributed block storage clusters
WO2017097006A1 (en) Real-time data fault-tolerance processing method and system
CN116680256B (en) Database node upgrading method and device and computer equipment
CN111049886B (en) Multi-region SDN controller data synchronization method, server and system
US11522966B2 (en) Methods, devices and systems for non-disruptive upgrades to a replicated state machine in a distributed computing environment
WO2015196692A1 (en) Cloud computing system and processing method and apparatus for cloud computing system
CN108763312B (en) Slave data node screening method based on load
CN115080661A (en) Database synchronization method, device, management and control platform and system
CN111400098B (en) Copy management method and device, electronic equipment and storage medium
CN115934742A (en) Fault processing method, device, equipment and storage medium
CN109947593B (en) Data disaster tolerance method, system, strategy arbitration device and storage medium
CN112243030A (en) Data synchronization method, device, equipment and medium of distributed storage system
CN115905270B (en) Method and device for determining active data nodes in database and storage medium
CN107153699A (en) A kind of method and device of dynamic expansion cluster server
CN116303775A (en) Log processing method and device, electronic equipment and storage medium

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