Distributed relational database consistency backup and recovery system and method

By introducing a backup and recovery management platform and tools into a distributed relational database, the execution of distributed transactions is blocked to ensure the consistency of backup and recovery data, and the problem of inconsistency between backup and recovery data in the existing technology is solved, and globally consistent data backup and recovery is achieved.

CN119806901APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411774015.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing distributed relational database backup technology is difficult to ensure the global consistency between the backup data and the restored data, which may cause the business data to be unavailable or untrusted, causing business chaos and errors.

Method used

By introducing a backup and recovery management platform, backup and recovery monitoring tool, distributed database middleware and backup and recovery tools into distributed relational databases, the execution of distributed transactions is blocked, and the data consistency during the backup process is ensured, and the full backup and incremental backup mechanisms are used during the recovery process to ensure strong global consistency of the restored data.

Benefits of technology

It realizes global consistency in data backup and recovery of distributed relational databases, avoids business problems caused by data unavailability or untrust, and ensures the reliability and consistency of data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806901A_ABST
    Figure CN119806901A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of databases, and discloses a distributed relational database consistency backup and recovery system and method.The system comprises a backup and recovery management platform used for receiving a first request and sending the first request to distributed database middleware; the backup recovery monitoring tool is used for sending the second request to the distributed database middleware according to a preset period; the distributed database middleware is used for receiving the first request and the second request, blocking execution of distributed transactions and sending the first request and the second request to the backup recovery tool; and the backup recovery tool is used for performing consistent backup or recovery in the backup recovery memory according to the first request or the second request. According to the method, execution of distributed transactions is blocked in the data backup process, consistent backup of the distributed relational database is guaranteed, meanwhile, it is guaranteed that subsequently recovered data is globally highly consistent, and the service problem caused by unavailability or incredibility of the data is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a distributed relational database consistency backup and recovery system and method. Background Art

[0002] The typical Share Nothing architecture distributed database is a bottom-up architecture, which combines multiple stand-alone database (MySQL) instances as the underlying storage nodes, and the distributed database middleware acts as a network proxy layer to shield the logic of sub-library and sub-table of massive data from the application. The backup data of the distributed relational database is mostly stored in data nodes. When restoring data, it is necessary to obtain the corresponding backup data from the backup system according to the recovery conditions and recovery time point and reversely restore it to the distributed relational database data node.

[0003] Most existing distributed relational database backup technology solutions often abandon the global consistency guarantee of distributed databases, split the backup of distributed relational databases into independent backup solutions for multiple components, and use the data consistency guarantee mechanism provided by the stand-alone system to guarantee the data consistency of each single component. However, this will result in the inability to guarantee global consistency when restoring data, which may cause problems such as unavailability and unreliability of business data, and then cause business confusion, errors and other accidents. In serious cases, it will cause the entire business to collapse. Therefore, how to ensure the consistency of backup data and recovery data is an issue that needs to be solved. Summary of the invention

[0004] In view of this, the present invention provides a distributed relational database consistency backup and recovery system and method to solve the problem that the prior art cannot ensure the global consistency of backup data and recovery data.

[0005] In a first aspect, the present invention provides a distributed relational database consistency backup and recovery system, wherein the distributed relational database includes a database storage node and a distributed database middleware, wherein the distributed database middleware is connected between the database storage node and an external application and is used to manage and operate the distributed relational database, and the distributed relational database consistency backup and recovery system includes: a backup and recovery management platform, a backup and recovery monitoring tool, a backup and recovery tool, and a backup and recovery storage device, wherein:

[0006] The backup and recovery management platform is used to receive the first request and send the first request to the distributed database middleware;

[0007] A backup and recovery monitoring tool, used to send the second request to the distributed database middleware according to a preset period;

[0008] The distributed database middleware is used to receive the first request and the second request, block the execution of the distributed transaction, and send the first request or the second request to the backup and recovery tool;

[0009] The backup and recovery tool is used to perform consistent backup or recovery in the backup and recovery storage according to the first request or the second request.

[0010] The distributed relational database consistency backup and recovery system provided by the present invention blocks the execution of distributed transactions during the data backup process, ensures the consistent backup of the distributed relational database, and at the same time ensures that the subsequently restored data is also globally strongly consistent, avoiding business problems caused by unavailable or unreliable data.

[0011] In a second aspect, the present invention provides a distributed relational database consistent backup and recovery method, which is applied to the distributed relational database consistent backup and recovery system of the first aspect, and the method includes:

[0012] Get external requests;

[0013] Perform consistent backup or consistent recovery of distributed relational databases based on external requests.

[0014] The distributed relational database consistency backup and recovery method provided by the present invention is based on a distributed relational database consistency backup and recovery system, which ensures that the backup and recovery of data in the distributed relational database are globally consistent, thereby avoiding business problems caused by unavailable or unreliable data.

[0015] In an optional implementation, performing consistent backup or consistent recovery on a distributed relational database according to an external request includes:

[0016] If the external request is a full backup request, the backup and recovery tool performs a full backup in the backup and recovery storage to obtain a full backup result;

[0017] If the full backup result is that the full backup is successful, the backup recovery tool obtains the full backup information from the backup recovery storage, and generates a consistent full backup set and a global consistency site for the full backup based on the full backup information.

[0018] The distributed relational database consistency backup and recovery method provided by the present invention generates a consistent full backup set and a global consistency site of the full backup after completing the full backup. When performing incremental recovery operations based on the consistency site, it can perform incremental recovery based on the backup set and the consistency site on the basis of the full recovery, and ensure that the restored data is globally consistent.

[0019] In an optional implementation, performing consistent backup or consistent recovery on a distributed relational database according to an external request further includes:

[0020] If the external request is an incremental backup request, the distributed database middleware interacts with each node of the distributed relational database to generate a global consistency site;

[0021] The backup and recovery tool backs up the incremental data in the distributed relational database to the backup and recovery storage according to the global consistency site. The incremental backup data includes the incremental data and the corresponding global consistency site.

[0022] The distributed relational database consistency backup and recovery method provided by the present invention interacts with each database node through the distributed database middleware to generate a global consistency site, stores the consistency site on the backup and recovery storage, synchronizes incremental data in real time, effectively and reliably ensures the consistency of the distributed relational database backup data, and achieves the purpose of overall consistency backup of the database.

[0023] In an optional implementation, if the distributed database middleware receives a full backup result indicating that the full backup is successful, or the distributed database middleware generates a global consistency site, the distributed transaction execution is unblocked.

[0024] The distributed relational database consistency backup and recovery method provided by the present invention can promptly unblock distributed transactions when the distributed transactions will not affect the consistency of the backup, avoid affecting the execution efficiency of the distributed transactions, and improve the comprehensive execution efficiency of each transaction in the distributed relational database.

[0025] In an optional embodiment, the method further includes:

[0026] If the backup and recovery management platform receives an external backup viewing request, it sends the backup viewing request to the distributed database middleware;

[0027] The distributed database middleware sends the backup viewing request to the backup recovery tool;

[0028] The backup recovery tool queries the backup information from the backup recovery storage according to the backup viewing request, and feeds the backup information back to the distributed database middleware;

[0029] The distributed database middleware feeds the backup information back to the backup and recovery management platform and displays it through the backup and recovery management platform.

[0030] The distributed relational database consistent backup and recovery method provided by the present invention provides a function of viewing backup information, which is convenient for management personnel to grasp the detailed situation of backup at any time and take corresponding measures according to the backup situation to ensure the smooth progress of consistent backup.

[0031] In an optional implementation, performing consistent backup or consistent recovery on a distributed relational database according to an external request further includes:

[0032] If the external request is a data recovery request, the backup recovery tool locates the consistent full backup set and the global consistency site according to the recovery request;

[0033] The backup and recovery tool restores the full data from the backup recovery storage according to the consistent full backup set, and restores the incremental data according to the global consistency site.

[0034] The distributed relational database consistency backup and recovery method provided by the present invention uses a consistent full backup set to restore full data, and uses a global consistency site to restore incremental data, thereby ensuring consistent recovery of database node data.

[0035] In an optional embodiment, the method further includes:

[0036] If the backup and recovery management platform receives an external request to view the recovery progress, it sends the request to view the recovery progress to the backup and recovery tool;

[0037] The backup and recovery tool determines the current recovery progress according to the request for viewing the recovery progress, and feeds back the current recovery progress to the backup and recovery management platform, which is then displayed on the backup and recovery management platform.

[0038] The distributed relational database consistency backup and recovery method provided by the present invention provides a function of viewing the recovery progress, which is convenient for management personnel to grasp the details of data recovery at any time and take corresponding measures according to the data recovery situation to ensure the smooth progress of data consistency recovery.

[0039] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 It is a structural diagram of a distributed relational database consistency backup and recovery system according to an embodiment of the present invention;

[0043] Figure 2 It is a flowchart of a method for consistent backup and recovery of a distributed relational database according to an embodiment of the present invention;

[0044] Figure 3 It is a flowchart of another method for consistent backup and recovery of a distributed relational database according to an embodiment of the present invention;

[0045] Figure 4 It is a complete process diagram of full backup in another method for consistent backup and recovery of a distributed relational database according to an embodiment of the present invention;

[0046] Figure 5 It is a complete process diagram of incremental backup in another method for consistent backup and recovery of a distributed relational database according to an embodiment of the present invention;

[0047] Figure 6 It is a schematic diagram of a complete process of data recovery in another method for consistent backup and recovery of a distributed relational database according to an embodiment of the present invention;

[0048] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0050] The embodiment of the present invention provides a distributed relational database consistency backup and recovery system and method, which backs up and restores data in the database through a global consistency site to achieve the effect of ensuring the global consistency of backup data and recovery data.

[0051] According to an embodiment of the present invention, a distributed relational database consistency backup and recovery system is provided. Figure 1 As shown, the distributed relational database includes a database storage node and a distributed database middleware. The distributed database middleware is connected between the database storage node and the external application and is used to manage and operate the distributed relational database. Figure 1 As shown, the distributed relational database consistency backup and recovery system includes: a backup and recovery management platform, a backup and recovery monitoring tool, a backup and recovery tool, and a backup and recovery storage.

[0052] The backup and recovery management platform is used to receive the first request and send the first request to the distributed database middleware.

[0053] Specifically, the backup and recovery management platform provides integrated operation and maintenance functions such as backup, recovery configuration, query, manual backup, manual recovery, etc. The first request is a manually input backup request or recovery request.

[0054] The backup and recovery monitoring tool is used to send the second request to the distributed database middleware according to a preset period.

[0055] Specifically, the backup and recovery monitoring tool can send the second request to the distributed database middleware according to a preset period to achieve scheduled automatic backup or automatic recovery. The second request is an automatic request to trigger backup tasks and recovery tasks. In addition, it can also monitor the backup progress and recovery progress.

[0056] The distributed database middleware is used for receiving the first request and the second request, blocking the execution of the distributed transaction, and sending the first request or the second request to the backup recovery tool.

[0057] Specifically, the distributed database middleware is located between the application and one or more databases, and is used to manage and coordinate multiple database systems distributed in different geographical locations. It provides functions such as sharding, obtaining consistency sites, etc. The distributed database middleware has powerful transaction management functions, including support for the ACID characteristics (consistency, isolation, durability, and atomicity) of distributed transactions to ensure that operations across multiple databases can be completed correctly and effectively address the access difficulties caused by shielding sharding at the application layer.

[0058] In response to the backup request, the distributed database middleware performs a second-level lock on the distributed transaction operation. During the locking process, non-transactional SQL and stand-alone transaction execution are not affected, but the distributed transaction submission will be blocked, and the SQL execution RT (runtime) will have sub-second jitter.

[0059] The backup and recovery tool is used to perform consistent backup or recovery in the backup and recovery storage according to the first request or the second request.

[0060] Specifically, the backup and recovery tool is used to perform full backup, incremental backup, data recovery and other tasks, and the backup and recovery storage is used to store full backup data, incremental backup data and corresponding consistent binary log (binlog) sites. The binlog site identifies the starting and ending position of each event in the binary log file. When each event is written to the binlog, a unique site is assigned, which is measured in bytes and indicates the specific position of the event in the file.

[0061] The distributed relational database consistency backup and recovery system provided in this embodiment blocks the execution of distributed transactions during the data backup process, ensures the consistent backup of the distributed relational database, and ensures that the subsequently restored data is also globally strongly consistent, avoiding business problems caused by unavailable or unreliable data.

[0062] According to an embodiment of the present invention, an embodiment of a distributed relational database consistent backup and recovery method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0063] In this embodiment, a distributed relational database consistent backup and recovery method is provided, which can be used in the above-mentioned computer system or the distributed relational database consistent backup and recovery system in the previous embodiment. Figure 2 FIG. 1 is a flow chart of a method for consistent backup and recovery of a distributed relational database according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0064] Step S101, obtaining an external request.

[0065] Specifically, the external request can be a backup request or a restore request manually submitted through the backup and restore management platform, or a backup request or a restore request automatically generated by the backup and restore monitoring tool according to a preset period. The external request is transmitted in the form of a backup instruction or a restore instruction.

[0066] Step S102: performing consistent backup or consistent recovery on the distributed relational database according to an external request.

[0067] Specifically, after the system receives a backup request or a restore request from the user, it will first perform a preliminary verification of the request, including checking whether the request format is correct, whether the requester has the corresponding authority, etc. Then, based on the specific requirements of the request, the system can also perform some preprocessing work, such as preparing the storage location for the backup data, checking whether the data files required for recovery exist, etc. This is just an example, but not limited to this.

[0068] Once all preparations are completed, the system will begin to perform backup or recovery operations: consistency backup operations include but are not limited to: copying database files, creating data snapshots, etc.; consistency recovery operations include but are not limited to: extracting data from backup media (such as backup recovery storage) and loading it back into the database, as an example only, but not limited to this.

[0069] In response to full backup instructions or incremental backup instructions, the distributed database middleware performs a second-level lock on distributed transactions. During the locking process, non-transactional SQL and stand-alone transaction execution are not affected, but distributed transaction submission is blocked, and SQL execution RT has sub-second jitter.

[0070] For full backup, the full data of each database node (MySQL) in the distributed database is backed up (physical backup) to the backup recovery storage through the backup recovery tool, and the consistency site of the storage node is read, where the full data of each storage node ends at the consistency site of the corresponding database.

[0071] For incremental backup, the distributed database middleware interacts with the database storage nodes to generate incremental global consistency sites and store them on the backup recovery storage. The backup recovery tool backs up the incremental data of each database node (MySQL) in the distributed relational database to the backup recovery storage in real time.

[0072] The distributed relational database consistency backup and recovery method provided in this embodiment is based on a distributed relational database consistency backup and recovery system, which ensures that the backup and recovery of data in the distributed relational database are globally consistent, avoiding business problems caused by unavailable or unreliable data.

[0073] In some optional embodiments, such as Figure 3 As shown, consistent backup or consistent recovery of a distributed relational database is performed according to an external request, including:

[0074] Step a1: If the external request is a full backup request, the backup and recovery tool performs a full backup in the backup and recovery storage to obtain a full backup result.

[0075] Specifically, if the external request is a full backup request, the full data of each database node in the distributed relational database is backed up to the backup recovery storage through the backup recovery tool. The backup recovery tool initializes the backup directory and the connection information of each database node on the backup recovery storage, remotely calls the physical backup recovery tool of the database node, copies (or streams) the full data of the corresponding database storage node to the backup recovery storage, and generates a consistency site that records the corresponding database node.

[0076] Step a2: If the full backup result is successful, the backup recovery tool obtains the full backup information from the backup recovery storage device, and generates a consistent full backup set and a global consistency site for the full backup according to the full backup information.

[0077] like Figure 4 As shown in the figure, the complete process of full backup includes:

[0078] (1) The backup and recovery management platform manually triggers a full backup, or the backup and recovery monitoring tool periodically triggers a full backup according to the preset backup policy.

[0079] (2) After receiving the full backup request, the distributed database middleware obtains the distributed lock through the zookeeper (zk) cluster and locks the execution of distributed transactions in seconds. During the locking process, the execution of non-transactional SQL and stand-alone transactions is not affected, but the submission of distributed transactions is blocked, and the SQL execution RT has sub-second jitter.

[0080] (3) The distributed database middleware notifies the backup and recovery tool to perform a full backup. The backup and recovery tool performs a streaming full physical backup on each database node and stores it in the backup and recovery storage. The asynchronous response notifies the database to start the full backup.

[0081] (4) The return result received by the database middleware is to start full backup, release the distributed lock, and unblock the execution of distributed transactions.

[0082] (5) After the full backup is completed, the distributed database middleware receives a return result indicating that the full backup is successful. The backup recovery tool then reads the backup information and generates a consistent full backup set and a global consistency site for the full backup based on the backup information.

[0083] It should be noted that if the full backup result is that the full backup is unsuccessful, a backup error report is generated and displayed to the user through the backup and recovery management platform to prompt the user to check according to the backup error report and back up again.

[0084] The distributed relational database consistency backup and recovery method provided in this embodiment generates a consistent full backup set and a global consistency site of the full backup after completing the full backup. When performing incremental recovery operations based on the consistency site, it can perform incremental recovery based on the backup set and the consistency site on the basis of the full recovery, and ensure that the restored data is globally consistent.

[0085] In some optional embodiments, such as Figure 3 As shown, the distributed relational database is backed up or restored according to an external request, and also includes:

[0086] Step b1: If the external request is an incremental backup request, the distributed database middleware interacts with each node of the distributed relational database to generate a global consistency site.

[0087] Specifically, if the external request is an incremental backup request, the backup and recovery tool performs an incremental backup operation, and uses the incremental backup and recovery tool to copy the incremental data (binlog) of each database node to the backup and recovery storage in real time; uses the distributed database middleware to interact with each database node, regularly generates consistent binlog sites, and backs up the site information on the backup and recovery storage.

[0088] Step b2: The backup and recovery tool backs up the incremental data in the distributed relational database to the backup and recovery storage according to the global consistency site. The incremental backup data includes the incremental data and the corresponding global consistency site.

[0089] Specifically, Figure 5 As shown in the figure, the complete process of incremental backup includes:

[0090] (1) The backup and recovery monitoring tool triggers incremental backup requests based on the preset backup strategy and sends them to the distributed database middleware.

[0091] (2) After receiving the incremental backup request, the distributed database middleware obtains the distributed lock through the zk cluster and performs a distributed transaction lock operation in seconds. During the locking process, non-transactional SQL and single-machine transaction execution are not affected, but the distributed transaction submission will be blocked, and the SQL execution RT will have sub-second jitter.

[0092] (3) The distributed database middleware interacts with each database node to generate a globally consistent binlog location and stores it in the backup recovery storage.

[0093] (4) After the distributed database middleware collects the locations of all database nodes, it releases the distributed lock and unblocks the execution of distributed transactions.

[0094] (5) The incremental backup tool copies the incremental data (binlog) of each database node to the backup recovery storage in real time; the incremental backup data + consistent binlog location constitute a complete incremental backup.

[0095] The distributed relational database consistency backup and recovery method provided in this embodiment interacts with each database node through the distributed database middleware to generate a global consistency site, stores the consistency data on the backup and recovery storage, synchronizes incremental data in real time, effectively and reliably ensures the consistency of the distributed relational database backup data, and achieves the purpose of overall consistency backup of the database.

[0096] In some optional implementations, if the distributed database middleware receives a full backup result indicating that the full backup is successful, or the distributed database middleware generates a global consistency site, the distributed transaction execution is unblocked.

[0097] Specifically, distributed locks are used to ensure that the full backup of each database node is globally consistent. The backup and recovery tool backs up the full data of each database node in the distributed system to the backup storage. The backup and recovery monitoring tool triggers the scheduled incremental backup operation. The distributed database middleware performs a second-level lock distributed transaction operation, interacts with the storage to generate a globally consistent binlog site, stores the consistent binlog site on the backup storage, and synchronizes the incremental data in real time. This effectively and reliably ensures the consistency of the distributed database backup data and achieves the purpose of overall consistent backup of the distributed database.

[0098] The distributed relational database consistency backup and recovery method provided in this embodiment can promptly unblock distributed transactions when the distributed transactions will not affect the consistency of the backup, avoid affecting the execution efficiency of the distributed transactions, and improve the comprehensive execution efficiency of each transaction in the distributed relational database.

[0099] In some optional embodiments, the method further comprises:

[0100] If the backup and recovery management platform receives an external backup viewing request, it sends the backup viewing request to the distributed database middleware.

[0101] The distributed database middleware sends the backup viewing request to the backup recovery tool.

[0102] The backup recovery tool queries the backup information from the backup recovery storage according to the backup viewing request, and feeds the backup information back to the distributed database middleware.

[0103] The distributed database middleware feeds the backup information back to the backup and recovery management platform and displays it through the backup and recovery management platform.

[0104] Specifically, Figure 4 or Figure 5 As shown, users can send backup request through the backup and recovery management platform and view the progress of full backup and incremental backup.

[0105] The distributed relational database consistent backup and recovery method provided in this embodiment provides a function of viewing backup information, which is convenient for management personnel to grasp the detailed situation of backup at any time and take corresponding measures according to the backup situation to ensure the smooth progress of consistent backup.

[0106] In some optional implementations, performing consistent backup or consistent recovery of a distributed relational database according to an external request further includes:

[0107] Step c1: If the external request is a data recovery request, the backup recovery tool locates the consistent full backup set and the global consistency site according to the recovery request.

[0108] Specifically, in response to the data recovery instruction, the backup recovery tool uses the backup recovery storage to restore the full backup data of each database node in the distributed database, wherein the recovery instruction includes the full backup time. The backup recovery tool copies the full backup data to the corresponding database nodes. The backup recovery tool uses the global consistency site and the incremental binlog file of each data node to perform incremental recovery on each of the database nodes.

[0109] Step c2: The backup and recovery tool recovers all data from the backup and recovery storage according to the consistent full backup set, and recovers incremental data according to the global consistent site.

[0110] Specifically, users can perform consistent backup and recovery through the backup and recovery management receipt, such as Figure 6 As shown, the complete data recovery process includes:

[0111] (1) The backup and recovery tool calculates the consistency points of the latest full backup and incremental backup based on the backup set time.

[0112] (2) The backup and recovery tool copies the full backup data to the corresponding database node based on the consistent backup set and performs full recovery.

[0113] (3) The backup and recovery tool uses the global consistency site and the incremental binlog files of each data node to perform incremental recovery on each database node.

[0114] (4) The backup and recovery tool updates the data recovery progress of each database node in real time.

[0115] The distributed relational database consistent backup and recovery method provided in this embodiment uses a consistent full backup set to restore the full data, and uses a global consistent site to restore the incremental data, thereby ensuring consistent recovery of database node data.

[0116] In some optional embodiments, the method further comprises:

[0117] If the backup and recovery management platform receives an external request for checking the recovery progress, it sends the request for checking the recovery progress to the backup and recovery tool.

[0118] The backup and recovery tool determines the current recovery progress according to the request for viewing the recovery progress, and feeds back the current recovery progress to the backup and recovery management platform, which is then displayed on the backup and recovery management platform.

[0119] Specifically, Figure 6 As shown, the user can send a request to view the recovery progress through the backup and recovery management platform and view the data recovery progress.

[0120] The distributed relational database consistency backup and recovery method provided in this embodiment provides a function of viewing the recovery progress, which is convenient for management personnel to grasp the details of data recovery at any time and take corresponding measures according to the data recovery situation to ensure the smooth progress of data consistency recovery.

[0121] The embodiment of the present invention also provides a computer device having the above Figure 1 The distributed relational database consistency backup and recovery system shown.

[0122] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0123] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0124] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0125] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0126] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0127] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0128] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0129] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A distributed relational database consistency backup and recovery system, wherein the distributed relational database comprises a database storage node and a distributed database middleware, wherein the distributed database middleware is connected between the database storage node and an external application and is used to manage and operate the distributed relational database, wherein: The system includes: a backup and recovery management platform, a backup and recovery monitoring tool, a backup and recovery tool, and a backup and recovery storage device, wherein: The backup and recovery management platform is used to receive the first request and send the first request to the distributed database middleware; The backup and recovery monitoring tool is used to send the second request to the distributed database middleware according to a preset period; The distributed database middleware is used to receive the first request and the second request, block the execution of the distributed transaction, and send the first request or the second request to the backup and recovery tool; The backup and recovery tool is used to perform consistent backup or recovery in the backup and recovery memory according to the first request or the second request.

2. A distributed relational database consistent backup and recovery method, characterized in that: The method is applied to the distributed relational database consistency backup and recovery system according to claim 1, and the method comprises: Get external requests; The distributed relational database is backed up or restored in a consistent manner according to the external request.

3. The method according to claim 2, characterized in that The performing consistent backup or consistent recovery of the distributed relational database according to the external request includes: If the external request is a full backup request, the backup recovery tool performs a full backup in the backup recovery storage to obtain a full backup result; If the full backup result is that the full backup is successful, the backup recovery tool obtains the full backup information from the backup recovery storage, and generates a consistent full backup set and a global consistency site for the full backup according to the full backup information.

4. The method according to claim 3, characterized in that The performing consistent backup or consistent recovery of the distributed relational database according to the external request further includes: If the external request is an incremental backup request, the distributed database middleware interacts with each node of the distributed relational database to generate a global consistency site; The backup and recovery tool backs up the incremental data in the distributed relational database to the backup and recovery storage according to the global consistency site, and the incremental backup data includes the incremental data and the corresponding global consistency site.

5. The method according to claim 4, characterized in that If the distributed database middleware receives the full backup result indicating that the full backup is successful, or the distributed database middleware generates a global consistency site, the distributed transaction execution is unblocked.

6. The method according to claim 4, characterized in that The method further comprises: If the backup and recovery management platform receives an external backup viewing request, the backup viewing request is sent to the distributed database middleware; The distributed database middleware sends the backup viewing request to a backup recovery tool; The backup recovery tool queries the backup information from the backup recovery storage according to the backup viewing request, and feeds back the backup information to the distributed database middleware; The distributed database middleware feeds the backup information back to the backup and recovery management platform, and displays it through the backup and recovery management platform.

7. The method according to claim 2, characterized in that The performing consistent backup or consistent recovery of the distributed relational database according to the external request further includes: If the external request is a data recovery request, the backup recovery tool locates the consistent full backup set and the global consistency site according to the recovery request; The backup and recovery tool recovers the full data from the backup and recovery storage according to the consistent full backup set, and recovers the incremental data according to the global consistent site.

8. The method according to claim 7, characterized in that The method further comprises: If the backup and recovery management platform receives an external request to view the recovery progress, the request to view the recovery progress is sent to the backup and recovery tool; The backup and recovery tool determines the current recovery progress according to the request to view the recovery progress, and feeds back the current recovery progress to the backup and recovery management platform, which is displayed on the backup and recovery management platform.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the distributed relational database consistency backup and recovery method described in any one of claims 2 to 8 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the distributed relational database consistency backup and recovery method described in any one of claims 2-8.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and computer storage medium

    CN112306743A

  • Data backup method and device for distributed database

    CN113254267A

  • Database snapshot generation method and device, electronic equipment and medium

    CN116089359A

  • Synchronized Backup and Recovery of Database Systems

    US20160147614A1