Backup method and device of distributed database, equipment and storage medium

By creating backup cluster objects in a distributed database, generating backup tasks and copying data to multiple backup storage nodes, the problem that traditional backup methods cannot meet the needs of distributed database backup and recovery is solved, and efficient distributed database backup and recover.

CN119493692APending Publication Date: 2025-02-21GUANGDONG ESHORE TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202311057888.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The existing technology cannot effectively meet the backup and recovery requirements of distributed databases, and the traditional single database backup method cannot adapt to the data backup and recovery requirements of distributed architectures.

Method used

By determining the backup cluster object of the distributed database corresponding to the business system, generating backup tasks, and copying the target cache data to several backup storage nodes in the backup storage pool, unified backup is achieved by creating backup cluster objects of the distributed database and recovery.

Benefits of technology

It realizes unified backup and efficient recovery of distributed databases, meets the data backup and recovery needs of distributed databases, and has overall clustered response capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493692A_ABST
    Figure CN119493692A_ABST
Patent Text Reader

Abstract

The invention provides a backup method, device and equipment for a distributed database and a storage medium, and the backup method for the distributed database comprises the steps: determining a backup cluster object of the distributed database corresponding to a business system, generating a backup task in the backup cluster object in response to a backup request, and executing the backup task through the backup cluster object. Determining target cache data of the distributed database, copying the target cache data into a plurality of backup storage nodes of a backup storage pool, and realizing unified backup by adopting a mode of creating a backup cluster object of the distributed database to meet a data backup requirement of the distributed database; meanwhile, the backup cluster is not a single database which is independent of each other, but is a new distributed cluster formed by a plurality of backup storage nodes, so that the overall clustering response capability is achieved, and the data recovery requirement of the distributed database can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a backup method, apparatus, device, and storage medium for a distributed database. Background Art

[0002] Databases have been developing since the 1960s, with the relational model being the most prominent. With the growing trend toward independent, controllable, and domestically produced databases, databases like the open-source relational database MySQL have rapidly gained popularity and adoption. The internet's impact has led to an exponential increase in the number of internet users, and the storage and retrieval of massive amounts of data has become increasingly difficult for a single database. This has led to the emergence of distributed databases based on MySQL and PostgreSQL. Currently, traditional single-database backup methods for distributed databases are unable to meet the backup and recovery requirements of distributed architectures. Summary of the Invention

[0003] The present invention provides a method, apparatus, device, and storage medium for backing up a distributed database to solve the problems existing in related technologies. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a method for backing up a distributed database, comprising:

[0005] Determine the backup cluster object of the distributed database corresponding to the business system;

[0006] In response to a backup request, generating a backup task in the backup cluster object;

[0007] The backup task is executed through the backup cluster object, target cache data of the distributed database is determined, and the target cache data is copied to a plurality of backup storage nodes in the backup storage pool.

[0008] In one embodiment, determining the backup cluster object of the distributed database corresponding to the business system includes:

[0009] Classify at least one business system;

[0010] A backup cluster object is generated for a distributed database corresponding to a business system with the same business type, with the cluster being the unit. The backup cluster object includes a master node and a slave node.

[0011] In one embodiment, before determining the target cache data of the distributed database, the method further includes:

[0012] Checking, by the master node, whether the distributed database has a table structure operation;

[0013] When there is a table structure operation, wait for the table structure operation to be completed, and then determine the target cache data of the distributed database;

[0014] Alternatively, when there is no table structure operation, target cache data of the distributed database is determined.

[0015] In one embodiment, determining the target cache data of the distributed database includes:

[0016] When the backup task is a full backup task, all cached data in the memory of the distributed database is used as target cache data;

[0017] or,

[0018] When the backup task is an incremental backup task, the incremental data cached in the memory of the distributed database is used as the target cache data.

[0019] In one embodiment, copying the target cache data to a plurality of backup storage nodes in a backup storage pool includes:

[0020] Execute binlog log switching processing through the master node and write the target cache data into the data file;

[0021] The data file is copied to several backup storage nodes in the backup storage pool through the slave node.

[0022] In one embodiment, copying the data file to the plurality of backup storage nodes in the backup storage pool through the slave node includes:

[0023] Determining a transmission load corresponding to the data file;

[0024] Determining a balanced load according to the transmission load and the number of the backup storage nodes;

[0025] The data files are transmitted in parallel to each of the backup storage nodes using the load balancing.

[0026] In one embodiment, generating a backup task in the backup cluster object in response to the backup request includes:

[0027] Sending a backup request to the slave node;

[0028] In response to the backup request, the backup task is generated in the slave node.

[0029] In a second aspect, an embodiment of the present application provides a backup device for a distributed database, comprising:

[0030] A determination module is used to determine the backup cluster object of the distributed database corresponding to the business system;

[0031] A generating module, configured to generate a backup task in the backup cluster object in response to a backup request;

[0032] An execution module is configured to execute the backup task through the backup cluster object, determine target cache data of the distributed database, and copy the target cache data to a plurality of backup storage nodes in a backup storage pool.

[0033] In one embodiment, the execution module is further configured to:

[0034] Checking, by the master node, whether the distributed database has a table structure operation;

[0035] When there is a table structure operation, wait for the table structure operation to be completed, and then determine the target cache data of the distributed database;

[0036] Alternatively, when there is no table structure operation, target cache data of the distributed database is determined.

[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method in any one of the above-mentioned embodiments.

[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the method in any one of the above-mentioned embodiments.

[0039] The beneficial effects of the above technical solution include at least:

[0040] Determine the backup cluster object of the distributed database corresponding to the business system, generate a backup task in the backup cluster object in response to the backup request, execute the backup task through the backup cluster object, determine the target cache data of the distributed database, copy the target cache data to several backup storage nodes in the backup storage pool, and implement unified backup by creating a backup cluster object of the distributed database to meet the data backup needs of the distributed database; at the same time, the backup cluster is not a separate single database, but a new distributed cluster formed by several backup storage nodes, so it has an overall clustered response capability, which can meet the data recovery needs of the distributed database.

[0041] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in this application and should not be construed as limiting the scope of this application.

[0043] Figure 1 This is a flowchart of the steps of a distributed database backup method according to an embodiment of the present application;

[0044] Figure 2 A schematic diagram of backing up and restoring data streams according to an embodiment of the present application;

[0045] Figure 3 This is a structural block diagram of a distributed database backup device according to an embodiment of the present application;

[0046] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] Hereinafter, only certain exemplary embodiments are briefly described. As will be appreciated by those skilled in the art, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and description are to be regarded as illustrative in nature and not restrictive.

[0048] Reference Figure 1 , showing a flowchart of a distributed database backup method according to an embodiment of the present application, the distributed database backup method may include at least steps S100-S300:

[0049] S100: Determine a backup cluster object of a distributed database corresponding to a business system.

[0050] S200 . In response to a backup request, generate a backup task in a backup cluster object.

[0051] S300 , executing a backup task through a backup cluster object, determining target cache data of a distributed database, and copying the target cache data to a plurality of backup storage nodes in a backup storage pool.

[0052] The technical solution of the embodiment of the present application determines the backup cluster object of the distributed database corresponding to the business system, generates a backup task in the backup cluster object in response to a backup request, executes the backup task through the backup cluster object, determines the target cache data of the distributed database, and copies the target cache data to several backup storage nodes in the backup storage pool. Unified backup is achieved by creating a backup cluster object of the distributed database to meet the data backup requirements of the distributed database. At the same time, the backup cluster is not a separate single database, but a new distributed cluster formed by several backup storage nodes, so that it has an overall clustered response capability and can meet the data recovery requirements of the distributed database.

[0053] In an embodiment of the present application, a highly available backup management and control terminal is built. The backup management and control terminal consists of two backup servers in a master-slave mode, which are recorded as the backup control terminal-master and the backup control terminal-slave. Both use VIP (Virtual IP Address) to provide services to the outside world. When the HA heartbeat detects a single point failure in the backup control terminal-master, it automatically switches to the backup control terminal-slave to ensure normal operation.

[0054] In the embodiment of the present application, a backup storage pool is configured, and the backup storage pool is composed of multiple backup storage nodes, such as Figure 2 The backup storage node A, backup storage node B, and backup storage node C shown in the figure may have the same or different capacities.

[0055] In one embodiment, step S100 includes steps S110-S120:

[0056] S110: Classify at least one business system.

[0057] S120: Generate a backup cluster object in cluster units for the distributed database corresponding to the business systems with the same business type.

[0058] In the embodiment of the present application, the business system is configured with a corresponding distributed database, and the online backup module classifies at least one business system. For example, one embodiment may classify the same business system, or classify multiple business systems, determine whether the business systems have the same business type, put the distributed databases corresponding to the business systems with the same business type together, and then automatically identify the master-slave relationship of the distributed database, and generate a backup cluster object (or distributed cluster) based on the cluster. The backup cluster object includes a master node and a slave node, and each distributed database is deployed with an online backup module. The distributed database can be a MySQL database. Figure 2As shown, multiple backup cluster objects can be formed, and the backup cluster objects include at least one master node Master and at least one corresponding slave node Slave. The slave node Slave can use the services provided by the backup management control terminal through the VIP.

[0059] In an embodiment of the present application, by classifying the business systems, generating backup cluster objects based on clusters, and uniformly backing up by creating distributed backup cluster objects, the backup clusters are no longer isolated databases, but new distributed clusters that can be quickly restored and pulled up, thereby having an overall clustered response capability, and can provide production emergency response, as well as a single independent node acting as a golden copy for direct use or some nodes joining the cluster for use, which is conducive to achieving efficient backup and recovery of distributed databases, making backup easier, the backup stored data can be quickly restored and used, and new distributed clusters can also be formed.

[0060] In one embodiment, step S200 includes steps S210-S220:

[0061] S210: Send a backup request to the slave node.

[0062] S220 . In response to the backup request, generate a backup task in the slave node.

[0063] In an embodiment of the present application, when backup is required, a backup request is generated through scheduling by the backup management control terminal, and the slave node responds to the backup request and generates a backup task in the slave node.

[0064] In one embodiment, in step S300, the backup task is performed by the master node and the slave node of the backup cluster object. Optionally, when the backup task is performed, steps S310-S330 are included.

[0065] In the embodiment of the present application, S310 includes steps S3101-S3102:

[0066] S3101. Check whether the distributed database has table structure operations through the master node.

[0067] S3102: When a table structure operation is required, wait for the table structure operation to be completed and then determine target cache data in the distributed database;

[0068] Alternatively, when there is no table structure operation, target cache data of the distributed database is determined.

[0069] In the embodiment of the present application, the online backup module connects to the master node to initiate backup pre-preparation. The purpose of backup pre-preparation is to perform data consistency check. Specifically, the master node checks whether the distributed database has table structure operations (table structure transaction operations). If there are table structure operations, the target cache data of the distributed database is determined after the table structure operations are completed. If there are no table structure operations, the target cache data of the distributed database is determined.

[0070] In the embodiment of the present application, S320: determining target cache data of the distributed database includes step S3201 or S3202:

[0071] S3201. When the backup task is a full backup task, all cache data in the memory of the distributed database is used as target cache data.

[0072] In an embodiment of the present application, when the backup task is a full backup task, all data needs to be fully backed up. Therefore, all cached data in the memory of the distributed database is used as target cache data to achieve a full backup.

[0073] S3202: When the backup task is an incremental backup task, the incremental data cached in the memory of the distributed database is used as the target cache data.

[0074] In an embodiment of the present application, when the backup task is an incremental backup task, since a full backup has been performed before, in order to improve the backup efficiency, it is only necessary to determine the incremental data added during the time interval from the last full backup to the current time for backup. Therefore, the incremental data cached in the memory of the distributed database is used as the target cache data.

[0075] In the embodiment of the present application, S330: copying the target cache data to several backup storage nodes in the backup storage pool includes steps S3301-S3302:

[0076] S3301. Execute binlog switch processing through the master node and write the target cache data into the data file.

[0077] In the embodiment of the present application, after the target cache data is determined, the master node executes a binlog log switching process to write the determined target cache data into the data file. It should be noted that the number of data files and the size of each data file can be set to a preset value in advance, or they can be evenly distributed according to the size of the target cache data and the preset size of the data files, thereby generating multiple data files.

[0078] S3302. Copy the data file from the node to several backup storage nodes in the backup storage pool.

[0079] In this embodiment of the present application, a data file is copied to several backup storage nodes in a backup storage pool by using a backup API interface from a slave node. It should be noted that the number of backup storage nodes can be one or more; different backup cluster objects can perform different backup tasks, and the backup tasks of different backup cluster objects can be executed asynchronously or synchronously.

[0080] It should be noted that if the backup task is an incremental backup task, in addition to generating data files, the current target cache data can also be written directly to the disk of the slave node. The target backup storage node or nodes where the historical full data corresponding to the current target cache data is located are determined. The target cache data on disk is then copied to the target backup storage node and then combined with the historical full data and the target cache data. The target cache data can also be compressed to generate the latest full data with minimal space. Tests have shown that the backup storage pool achieves a data compression rate of 70%, significantly reducing backup storage space usage.

[0081] Specifically, S3302 may include S3302A-S3302C:

[0082] S3302A. Determine the transmission load corresponding to the data file.

[0083] S3302B. Determine load balancing based on the transmission load and the number of backup storage nodes.

[0084] S3302C, use load balancing to transfer data files to each backup storage node in parallel.

[0085] In an embodiment of the present application, the slave node can determine the transmission load required to copy the data file, and at the same time determine the number of backup storage nodes that need to be used. The number of backup storage nodes can be determined by the remaining storage capacity of the backup storage node. For example, a backup storage node with a remaining storage capacity greater than a storage threshold is selected as the backup storage node that needs to be used. In other embodiments, other methods can be used to determine it. Then, based on the transmission load and the number of backup storage nodes, a balanced load is determined, and the balanced load is used to transmit the data file in parallel to each backup storage node that needs to be used. The embodiment of the present application realizes the parallel writing of the target cache data determined by the backup cluster object to different backup storage nodes through load balancing distribution, thereby improving the transmission IO performance and backup efficiency of the backup.

[0086] It should be noted that the backup method of the distributed database in the embodiment of the present application can realize the batch parallel rapid pull-up of the distributed database. Specifically: the backup management control terminal can pre-set the mount recovery pre-template, in which the distributed database corresponding to the backup cluster object is dispersedly mounted to different recovery nodes. When a recovery request is received or a data anomaly is detected, the mount recovery pre-template is executed to achieve data recovery. Among them, a backup storage node can correspond to one or more recovery nodes, and they are distributed as evenly as possible to multiple recovery nodes. Multiple instances can be mounted on a recovery node, different listening ports are configured, and the entire backup cluster object is configured to be pulled up to a unified backup time point. The distributed database is mounted and restored in parallel by multiple recovery nodes to achieve consistent recovery of the distributed database.

[0087] The backup method of the distributed database in the embodiment of the present application:

[0088] 1) Using a highly available backup management control terminal can avoid the problem of a single node in the backup service being suspended, causing all backup tasks on that node to be suspended;

[0089] 2) Use the backup method on the slave database (slave node) to ensure that the distributed database can perform backup work without affecting the normal operation of the master database (master node). When a master-slave switch occurs, it automatically identifies the new slave database and continues the backup.

[0090] 3) For distributed databases, compared with a single backup centralized storage of backup data, a distributed backup storage pool with load balancing is used. During backup, the backup data of each data node is written in batches to different backup storage nodes in parallel, which greatly improves the backup rate and efficiency. During recovery, multiple backup storage nodes correspond to multiple recovery nodes for mounting and recovery, realizing efficient data recovery in scenarios with high concurrency recovery requirements.

[0091] Reference Figure 3 , shows a structural block diagram of a distributed database backup device according to an embodiment of the present application, which may include:

[0092] A determination module is used to determine the backup cluster object of the distributed database corresponding to the business system;

[0093] A generation module, configured to generate a backup task in a backup cluster object in response to a backup request;

[0094] The execution module is used to execute the backup task through the backup cluster object, determine the target cache data of the distributed database, and copy the target cache data to several backup storage nodes in the backup storage pool.

[0095] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method and will not be repeated here.

[0096] Reference Figure 4 , shows a block diagram of an electronic device according to an embodiment of the present application. The electronic device includes a memory 310 and a processor 320. The memory 310 stores instructions executable on the processor 320, which loads and executes the instructions to implement the distributed database backup method in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.

[0097] In one embodiment, the electronic device further includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320, and the communication interface 330 are implemented independently, the memory 310, the processor 320, and the communication interface 330 can be interconnected through a bus and complete communication with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0098] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.

[0099] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the distributed database backup method provided in the above embodiment.

[0100] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided in the embodiment of the present application.

[0101] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory. The input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

[0102] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the advanced reduced instruction set machine (ARM) architecture.

[0103] Furthermore, optionally, the above-mentioned memory may include read-only memory and random access memory, and may also include non-volatile random access memory. The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory may include random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).

[0104] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0105] In the description of this specification, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.

[0106] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.

[0107] Any process or method description in a flow chart or otherwise described herein can be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process. The scope of the preferred embodiments of the present application includes additional implementations in which the functions may be performed in a different order than shown or discussed, including in a substantially simultaneous manner or in a reverse order depending on the functions involved.

[0108] The logic and / or steps represented in the flowchart or otherwise described herein may be considered, for example, as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device).

[0109] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0110] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the aforementioned integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, or an optical disk, etc.

[0111] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A distributed database backup method, characterized in that: include: Determine the backup cluster object of the distributed database corresponding to the business system; In response to the backup request, generating a backup task in the backup cluster object; The backup task is executed through the backup cluster object, target cache data of the distributed database is determined, and the target cache data is copied to a plurality of backup storage nodes in the backup storage pool.

2. The distributed database backup method according to claim 1, characterized in that: The step of determining the backup cluster object of the distributed database corresponding to the business system includes: classifying at least one business system; A backup cluster object is generated in cluster units for a distributed database corresponding to a business system with the same business type, wherein the backup cluster object includes a master node and a slave node.

3. The distributed database backup method according to claim 2, characterized in that: Before determining the target cache data of the distributed database, the method further includes: Checking, by the master node, whether the distributed database has a table structure operation; When there is a table structure operation, wait for the table structure operation to be completed, and then determine the target cache data of the distributed database; Alternatively, when there is no table structure operation, the target cache data of the distributed database is determined.

4. The distributed database backup method according to claim 2 or 3, characterized in that: Determining the target cache data of the distributed database includes: When the backup task is a full backup task, all cache data in the memory of the distributed database is used as target cache data; or, When the backup task is an incremental backup task, the incremental data cached in the memory of the distributed database is used as the target cache data.

5. The distributed database backup method according to claim 2, characterized in that: The step of copying the target cache data to a plurality of backup storage nodes in a backup storage pool includes: Execute binlog log switching processing through the master node and write the target cache data into the data file; The data file is copied to several backup storage nodes in the backup storage pool through the slave node.

6. The distributed database backup method according to claim 5, characterized in that: The step of copying the data file to the plurality of backup storage nodes in the backup storage pool through the slave node includes: Determining a transmission load corresponding to the data file; Determining a balanced load according to the transmission load and the number of the backup storage nodes; The data files are transmitted to each of the backup storage nodes in parallel by utilizing the load balancing.

7. The distributed database backup method according to claim 2, characterized in that: In response to the backup request, generating a backup task in the backup cluster object includes: Sending a backup request to the slave node; In response to the backup request, the backup task is generated in the slave node.

8. A backup device for a distributed database, characterized in that: include: A determination module is used to determine the backup cluster object of the distributed database corresponding to the business system; A generating module, configured to generate a backup task in the backup cluster object in response to a backup request; An execution module is used to execute the backup task through the backup cluster object, determine the target cache data of the distributed database, and copy the target cache data to a plurality of backup storage nodes in the backup storage pool.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Implementation method, system and device of multi-copy survivability backup medium pool and medium

    CN120523654A

  • Cache data recovery method and electronic equipment

    CN120653492A

  • Cache data recovery method and electronic device

    CN120653492B