CN110362429B - Continuous data protection method, system, device and medium for database - Google Patents

Continuous data protection method, system, device and medium for database Download PDF

Info

Publication number
CN110362429B
CN110362429B CN201910628979.XA CN201910628979A CN110362429B CN 110362429 B CN110362429 B CN 110362429B CN 201910628979 A CN201910628979 A CN 201910628979A CN 110362429 B CN110362429 B CN 110362429B
Authority
CN
China
Prior art keywords
database
time
computing node
updated
configuration
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.)
Active
Application number
CN201910628979.XA
Other languages
Chinese (zh)
Other versions
CN110362429A (en
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.)
Ucloud Technology Co ltd
Original Assignee
Ucloud 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 Ucloud Technology Co ltd filed Critical Ucloud Technology Co ltd
Priority to CN201910628979.XA priority Critical patent/CN110362429B/en
Publication of CN110362429A publication Critical patent/CN110362429A/en
Application granted granted Critical
Publication of CN110362429B publication Critical patent/CN110362429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Abstract

The present invention relates in particular to a method, system, device and medium for continuous data protection of a database. The databases include a first database that is visible to a user and a second database that is invisible to the user, the second database is a delayed copy of the first database, the first database is a first database at a first time, the second database is a first database at a second time, the second time is delayed from the first time by a predetermined time period, the method comprising: receiving an instruction to retrieve the first database at the third time; updating the second database according to the instruction of retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time; and switching the updated second database to be visible to a user, or switching the updated second database to be a new first database. The invention can realize the purpose of continuous data protection under the scene of database misoperation or database damage.

Description

Continuous data protection method, system, device and medium for database
Technical Field
The present invention relates to the field of databases, and in particular, to a method, system, device, and medium for continuous data protection of a database.
Background
At present, in a scenario of database misoperation or database damage, in order to retrieve a previous database, the industry generally adopts the following three ways:
the first method is to cold prepare the database in full quantity and retrieve the previous database by combining an incremental log and performing a file return operation. But this approach requires updating the backup database from full cold standby time to the time before failure, and recovery time is slow.
The second is to flash back the database by a reverse operation to retrieve the previous database. However, this approach has a limitation on the operation type of the database, for example, if the operation type of the database is a DDL operation, the database cannot be flashed back because the DDL operation does not support the inverse operation.
The third is to use historical snapshots to retrieve a database of snapshot times. But recovery times are also slow in this way and only the database at a particular snapshot time can be retrieved, rather than the database before the failure, and therefore, unnecessary data loss may occur to the user.
Disclosure of Invention
The invention aims to provide a method, a system, equipment and a medium for protecting continuous data of a database, which can recover to any time point in a certain period to retrieve the database under the scene of database misoperation or database damage, have high recovery speed, have no limit on the operation type of the database and realize the purpose of protecting the continuous data.
The invention discloses a continuous data protection method of a database, wherein the database comprises a first database and a second database, the first database is visible to a user, the second database is invisible to the user, the second database is copied in a delayed manner, the first database is the first database at a first time, the second database is the first database at a second time, and the second time is delayed by a preset time period compared with the first time, the method comprises the following steps:
receiving an instruction to retrieve the first database at the third time;
updating the second database according to the instruction of retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
and switching the updated second database to be visible to a user, or switching the updated second database to be a new first database.
Optionally, the first database is provided by a first computing node and the second database is provided by a second computing node, the configuration of the second computing node being lower than the configuration of the first computing node when copying is delayed and higher than the configuration of the first computing node when updating.
Optionally, the configuration of the second computing node is lower than the configuration of the first computing node when the copying is delayed, and the configuration of the second computing node is equal to the configuration of the first computing node when the copying is updated.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node when the copying is delayed, and the configuration of the second computing node is higher than the configuration of the first computing node when the copying is updated.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node after the updating.
Alternatively, the predetermined period of time is set according to the delay time setting instruction.
Optionally, the second database is updated according to an incremental log between the third time and the second time.
The invention discloses a continuous data protection system of a database, wherein the database comprises a first database and a second database, the first database is visible to a user, the second database is invisible to the user, the second database is a delay copy first database, the first database is a first database at a first time, the second database is a first database at a second time, and the second time is delayed for a preset time period than the first time, the system comprises:
a receiving module configured to receive an instruction to retrieve the first database at the third time;
the updating module is configured to update the second database according to an instruction for retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
a switching module configured to switch the updated second database to be visible to a user or to switch the updated second database to be a new first database.
Optionally, the first database is provided by a first computing node and the second database is provided by a second computing node, the configuration of the second computing node being lower than the configuration of the first computing node when copying is delayed and higher than the configuration of the first computing node when updating.
Optionally, the configuration of the second computing node is lower than the configuration of the first computing node when the copying is delayed, and the configuration of the second computing node is equal to the configuration of the first computing node when the copying is updated.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node when the copying is delayed, and the configuration of the second computing node is higher than the configuration of the first computing node when the copying is updated.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node after the updating.
Optionally, the system further comprises: a setting module configured to set a predetermined period of time according to the delay time setting instruction.
Optionally, the update module updates the second database according to the incremental log between the third time and the second time.
The invention discloses a continuous data protection device of a database, the device comprises a memory and a processor, the memory is used for storing computer executable instructions, the processor is configured to execute the instructions to implement a continuous data protection method of the database, the database comprises a first database and a second database, the first database is visible for users, the second database is invisible for users, the second database delays to copy the first database, the first database is a first database at a first time, the second database is a first database at a second time, and the second time is delayed by a preset time period compared with the first time, the method comprises the following steps:
receiving an instruction to retrieve the first database at the third time;
updating the second database according to the instruction of retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
and switching the updated second database to be visible to a user, or switching the updated second database to be a new first database.
The present invention discloses a computer storage medium encoded with a computer program, the computer program comprising instructions that are executable by one or more computers to perform a method of continuous data protection of a database, the database comprising a first database and a second database, the first database being visible to a user, the second database being invisible to the user, the second database delaying replication of the first database, the first database being a first database at a first time, the second database being a first database at a second time, the second time being delayed from the first time by a predetermined time period, the method comprising:
receiving an instruction to retrieve the first database at the third time;
updating the second database according to the instruction of retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
and switching the updated second database to be visible to a user, or switching the updated second database to be a new first database.
Compared with the prior art, the invention has the main differences and the effects that:
first, the present invention can be universally applied to database types that employ a "replication" model for data redundancy, including a relational database (typically representing MySQL) and a non-relational database (typically representing MongoDB), the databases including a first database that is visible to the user and a second database that is invisible to the user, the first database having a first IP address and the second database having a second IP address, the second database delaying replication of the first database, the first database being the first database at a first time and the second database being the first database at a second time, the second time being delayed from the first time by a predetermined time period. The first database can be a master database, the second database can be a slave database (or a backup database), a user can perform reading and writing operations on the first database, and the invisible second database synchronizes the first database all the time, so that continuous data protection is realized, and normal operation of the user at ordinary times cannot be influenced.
Secondly, when receiving an instruction from a user to retrieve the first database at the third time, the instruction is sent to the second database, so that the replication process of the second database can be stopped, and the second database is updated according to the instruction, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time, so that the database can be recovered to any time point within a certain period to retrieve the database.
And thirdly, the updated second database can be switched to be visible to the user, for example, the second IP address is set to be visible, the user can select to continue reading and writing on the first database, or to read and write on the updated second database.
The first database is provided by a first computing node, the second database is provided by a second computing node, wherein the computing nodes can be virtual computing nodes provided on the cloud and the like, the configuration of the second computing node is lower than that of the first computing node during delayed replication, so that the backup cost can be reduced, the configuration of the second computing node is higher than that of the first computing node during updating, so that the database retrieving speed can be increased, and the configuration of the second computing node is equal to that of the first computing node after updating, so that the configuration of the second computing node can be adjusted to be in a standard state.
Thirdly, when receiving a delay time setting instruction from a user, the instruction is sent to the second database, and according to the instruction, a predetermined time period is set, the user can define the predetermined time period in advance, and the user is allowed to flexibly set, the predetermined time period indicates a time period in which the database can be shifted back, if the predetermined time period is longer, a database before the database is longer can be retrieved, if the predetermined time period is shorter, the database retrieving speed is faster, and particularly for a large-capacity database, the retrieving speed can be increased by several times compared with the above-mentioned method in the industry.
Finally, the second database is updated according to the incremental log between the third time and the second time, wherein the operations of reading and writing and the like performed by the user on the first database can be recorded in the incremental log, and when the second database is updated, the user operations between the third time and the second time are applied to the second database, so that the first database at the third time can be retrieved, and the operation type of the database is not limited, for example, if the operation type of the database is a DDL operation, the database can also be retrieved.
Drawings
FIG. 1 is a block diagram of a hardware configuration of a computer terminal of the continuous data protection method of a database of the present invention;
FIG. 2 is a schematic diagram of a method of continuous data protection of a database according to a first embodiment of the present invention;
FIG. 3 is a flow chart illustrating a method for continuous data protection of a database according to a first embodiment of the present invention;
fig. 4 is a schematic structural diagram of a continuous data protection system of a database according to a second embodiment of the present invention.
Detailed Description
In order to make the purpose and technical solution of the embodiments of the present invention clearer, the technical solution of the embodiments of the present invention will be clearly and completely described below with reference to the drawings of the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention without any inventive step, are within the scope of protection of the invention.
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for continuous data protection of a database, it should be noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method provided by the application mode can be executed in a mobile terminal, a computer terminal or a server. Taking the example of the computer terminal, fig. 1 is a hardware block diagram of the computer terminal of the continuous data protection method for the database according to the embodiment of the present invention. As shown in fig. 1, the computer terminal 100 may include one or more processors 101 (only one is shown in the figure) (the processor 101 may include but is not limited to a processing device such as a central processing unit CPU, an image processor GPU, a digital signal processor DSP, a microprocessor MCU, or a programmable logic device FPGA), an input-output interface 102 for interacting with a user, a memory 103 for storing data, and a transmission device 104 for communication function, and the processor 101, the input-output interface 102, the memory 103, and the transmission device 104 are connected to each other via a bus 105. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, computer terminal 100 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 103 may be used to store a database, a queue, and software programs and modules of application software, such as program instructions/modules corresponding to the continuous data protection method of the database in the embodiment of the present invention, and the processor 101 executes various functional applications and data processing by running the software programs and modules stored in the memory 103, so as to implement the continuous data protection method of the database. The memory 103 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 103 may further include memory located remotely from the processor 101, which may be connected to the computer terminal 100 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 104 is used to receive or transmit data via a network, which may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. Specific examples of the network described above may include the internet provided by a communication provider of the computer terminal 100.
A first embodiment of the invention relates to a method for continuous data protection of a database, the database comprising a first database and a second database, the first database being visible to a user and the second database being invisible to the user, the second database delaying copying of the first database, the first database being a first database at a first time, the second database being a first database at a second time, the second time being delayed from the first time by a predetermined time period.
Fig. 2 is a schematic diagram of a continuous data protection method of the database. Specifically, as shown in fig. 2, the method may be generally applied to database types that employ a "copy" mode for data redundancy, including a relational database (typically representing MySQL) and a non-relational database (typically representing MongoDB), the databases including a first database a1 and a second database a2, the first database a1 being visible to the user, the second database a2 being invisible to the user, the first database a1 having a first IP address IP1, the second database a2 having a second IP address IP2, the second database a2 delaying copying the first database a1, the first database a1 being the first database a1 at a first time T1, the second database a2 being the first database a1 at a second time T2, the second time T2 being delayed from the first time T1 by a predetermined time period Δ T, the first time T1 being the current time, the first database a1 being a command to send a time when the user returns the first database a1, for example, a user sends a command to retrieve the first database A1 at 9 AM, when the first database A1 is the first database A1 at 9 AM, and if the predetermined time period Δ T is 1 hour, when the second database A2 is the first database A1 at 8 AM. The first database a1 may be a master database, the second database a2 may be a slave database (or a backup database), a user may read and write on the first database a1, and the invisible second database a2 may synchronize the first database a1 all the time, so as to achieve continuous data protection without affecting normal operation of the user at ordinary times.
When an instruction to retrieve the first database a1 at the third time T3 is received from the user, the instruction is transmitted to the second database a2, the copying process of the second database a2 may be stopped, and according to the instruction, the second database a2 is updated, the updated second database a2 is the first database a1 at the third time T3, the third time T3 is between the first time T1 and the second time T2, the third time T3 may be a time before a database malfunction or database damage, for example, the third time T3 is 8 am 40 min 00 s, 8 am 23 min 08 s, or 8 am 56 min 35 s, etc., so that it is possible to recover to an arbitrary time point within a certain period to retrieve the database.
The updated second database a2 may be switched to be visible to the user, for example, the second IP address IP2 is set to be visible, the user may select to continue operations such as reading and writing on the first database a1, or to perform operations such as reading and writing on the updated second database a2, or the updated second database a2 may be switched to the new first database a1, for example, the second IP address IP2 is replaced with the first IP address IP1, and the user may directly perform operations such as reading and writing on the new first database a1, thereby implementing database rollback, and eliminating the influence of database misoperation or database damage.
The first database A1 is provided by a first computing node, the second database A2 is provided by a second computing node, wherein the computing nodes can be virtual computing nodes provided in the cloud and the like, the configuration of the second computing node A2 is lower than that of the first computing node A1 during delayed replication, so that the backup cost can be reduced, the configuration of the second computing node A2 is higher than that of the first computing node A1 during updating, so that the database recovery speed can be accelerated, and the configuration of the second computing node A2 is equal to that of the first computing node A1 after updating, so that the configuration of the second computing node A2 can be adjusted to a standard state. It is understood that the configuration of the compute node includes the CPU, memory, and/or IO capabilities of the compute node, among others.
When a delay time setting instruction is received from a user, the instruction is sent to the second database a2, and according to the instruction, a predetermined time period Δ T is set, where the predetermined time period Δ T may be 1 hour, 0.5 hour, 2 hours, 1 week, 1 month, etc., the predetermined time period Δ T may be predefined by the user, and flexible setting is allowed for the user, and indicates a time period during which the database can be shifted back, for example, if the predetermined time period Δ T is 1 hour, the database can be shifted back within 1 hour, if the predetermined time period Δ T is longer, the database before a longer time can be retrieved, if the predetermined time period Δ T is shorter, the database retrieval speed is faster, and particularly for a large database, the recovery speed may be increased by several times compared to the above-mentioned method in the industry.
And updating the second database A2 according to the incremental log between the third time T3 and the second time T2, wherein the reading and writing operations of the user on the first database A1 can be recorded in the incremental log, and when the second database A2 is updated, the user operations between the third time T3 and the second time T2 are applied to the second database A2, so that the first database A1 of the third time T3 can be found, and the operation type of the database is not limited, for example, if the operation type of the database is a DDL operation, the database can also be found.
Fig. 3 is a flow chart diagram of the continuous data protection method of the database. Specifically, as shown in fig. 3, the method for continuous data protection of a database includes the following steps:
step 302, receiving an instruction for retrieving the first database at the third time;
step 304, updating the second database according to the instruction of retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
step 306, the updated second database is switched to be visible to the user, or the updated second database is switched to be the new first database.
Wherein the method is universally applicable to database types that employ a "replication" model for data redundancy, including relational databases (typically representing MySQL) and non-relational databases (typically representing MongoDB), the databases including a first database that is visible to the user and a second database that is invisible to the user, the first database having a first IP address and the second database having a second IP address, the second database delaying replication of the first database, the first database being the first database at a first time, the second database being the first database at a second time that is delayed from the first time by a predetermined time period, the first time may be a current time, the current time being an instruction sending time when the user sends an instruction to retrieve the first database, e.g., the user sends an instruction to retrieve the first database at 9 am, the first database is now the first database at 9 am, and if the predetermined time period is 1 hour, then the second database is now the first database at 8 am. The first database can be a master database, the second database can be a slave database (or a backup database), a user can perform reading and writing operations on the first database, and the invisible second database synchronizes the first database all the time, so that continuous data protection is realized, and normal operation of the user at ordinary times cannot be influenced.
When an instruction for retrieving the first database at the third time is received from the user, the instruction is sent to the second database, the copying process of the second database may be stopped, and according to the instruction, the second database is updated, the updated second database is the first database at the third time, the third time is between the first time and the second time, the third time may be a time before the database is misoperated or the database is damaged, for example, the third time is 40 minutes 00 seconds at 8 am, 23 minutes 08 seconds at 8 am, 56 minutes 35 seconds at 8 am, and the like, so that the database may be retrieved at any time point within a certain period.
The updated second database may be switched to be visible to a user, for example, the second IP address is set to be visible, the user may select to continue operations such as reading and writing on the first database, or perform operations such as reading and writing on the updated second database, or the updated second database may be switched to be the new first database, for example, the second IP address is replaced by the first IP address, and the user may directly perform operations such as reading and writing on the new first database, so that the database is restored, and the influence of database misoperation or database damage may be eliminated.
Optionally, the first database is provided by a first computing node and the second database is provided by a second computing node, the configuration of the second computing node being lower than the configuration of the first computing node when copying is delayed and higher than the configuration of the first computing node when updating.
The computing nodes can be virtual computing nodes provided by the cloud and the like, the configuration of the second computing node is lower than that of the first computing node when the copying is delayed, so that the backup cost can be reduced, and the configuration of the second computing node is higher than that of the first computing node when the database is updated, so that the database retrieving speed can be increased. It is understood that the configuration of the compute node includes the CPU, memory, and/or IO capabilities of the compute node, among others.
Optionally, the configuration of the second computing node is lower than the configuration of the first computing node when the copying is delayed, so that the backup cost can be reduced, and the configuration of the second computing node is equal to the configuration of the first computing node when the copying is updated.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node when the copying is delayed, and the configuration of the second computing node is higher than the configuration of the first computing node when the copying is updated, so that the database retrieval speed can be increased.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node after the updating, so that the configuration of the second computing node can be adjusted to a standard state.
Alternatively, the predetermined period of time is set according to the delay time setting instruction.
When a delay time setting instruction is received from a user, the instruction is sent to the second database, and according to the instruction, a predetermined time period is set, wherein the predetermined time period may be 1 hour, 0.5 hour, 2 hours, 1 week, 1 month, and the like, the user may define the predetermined time period in advance and allow the user to flexibly set, the predetermined time period indicates a time period during which the database can be shifted back, for example, if the predetermined time period is 1 hour, the database can be shifted back to within 1 hour, if the predetermined time period is longer, a database before the database can be retrieved, if the predetermined time period is shorter, the database can be retrieved at a higher speed, and particularly for a large-capacity database, the recovery speed can be increased by several times compared with the above-mentioned common methods in the industry.
Optionally, the second database is updated according to an incremental log between the third time and the second time.
The operation of reading and writing and the like performed by the user on the first database can be recorded in the incremental log, and when the second database is updated, the user operation between the third time and the second time is applied to the second database, so that the first database at the third time can be retrieved, and the operation type of the database is not limited, for example, if the operation type of the database is DDL operation, the database can also be retrieved.
A second embodiment of the present invention is directed to a system for continuous data protection of a database, the database comprising a first database and a second database, the first database being visible to a user and the second database being invisible to the user, the second database delaying replication of the first database, the first database being a first database at a first time, the second database being a first database at a second time, the second time being delayed from the first time by a predetermined time period.
Fig. 4 is a schematic structural diagram of the continuous data protection system of the database. Specifically, as shown in fig. 4, the continuous data protection system of the database includes:
a receiving module configured to receive an instruction to retrieve the first database at the third time;
the updating module is configured to update the second database according to an instruction for retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
a switching module configured to switch the updated second database to be visible to a user or to switch the updated second database to be a new first database.
Optionally, the first database is provided by a first computing node and the second database is provided by a second computing node, the configuration of the second computing node being lower than the configuration of the first computing node when copying is delayed and higher than the configuration of the first computing node when updating.
Optionally, the configuration of the second computing node is lower than the configuration of the first computing node when the copying is delayed, and the configuration of the second computing node is equal to the configuration of the first computing node when the copying is updated.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node when the copying is delayed, and the configuration of the second computing node is higher than the configuration of the first computing node when the copying is updated.
Optionally, the configuration of the second computing node is equal to the configuration of the first computing node after the updating.
Optionally, the system further comprises: a setting module configured to set a predetermined period of time according to the delay time setting instruction.
Optionally, the update module updates the second database according to the incremental log between the third time and the second time.
The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
A third embodiment of the invention is directed to a continuous data protection apparatus for a database, the apparatus comprising a memory storing computer executable instructions and a processor configured to execute the instructions to perform a continuous data protection method for the database, the database comprising a first database and a second database, the first database being visible to a user, the second database being invisible to the user, the second database delaying replication of the first database, the first database being the first database at a first time, the second database being the first database at a second time, the second time being delayed from the first time by a predetermined time period, the method comprising:
receiving an instruction to retrieve the first database at the third time;
updating the second database according to the instruction of retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
and switching the updated second database to be visible to a user, or switching the updated second database to be a new first database.
The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
A fourth embodiment of the invention is directed to a computer storage medium encoded with a computer program, the computer program comprising instructions executable by one or more computers to perform a method of continuous data protection of a database, the database comprising a first database and a second database, the first database being visible to a user, the second database being invisible to the user, the second database delaying replication of the first database, the first database being a first database at a first time, the second database being a first database at a second time, the second time being delayed from the first time by a predetermined time period, the method comprising:
receiving an instruction to retrieve the first database at the third time;
updating the second database according to the instruction of retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
and switching the updated second database to be visible to a user, or switching the updated second database to be a new first database.
The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
Each method embodiment of the present invention can be implemented by software, hardware, firmware, or the like. Whether the present invention is implemented as software, hardware, or firmware, the instruction code may be stored in any type of computer-accessible memory (e.g., permanent or modifiable, volatile or non-volatile, solid or non-solid, fixed or removable media, etc.). Also, the Memory may be, for example, Programmable Array Logic (PAL), Random Access Memory (RAM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), a magnetic disk, an optical disk, a Digital Versatile Disk (DVD), or the like.
It should be noted that, each unit/module mentioned in each device embodiment of the present invention is a logical unit/module, and physically, one logical unit may be one physical unit, or may be a part of one physical unit, or may be implemented by a combination of multiple physical units, and the physical implementation manner of these logical units itself is not the most important, and the combination of the functions implemented by these logical units is the key to solve the technical problem provided by the present invention. Furthermore, the above-mentioned embodiments of the apparatus of the present invention do not introduce elements that are less relevant for solving the technical problems of the present invention in order to highlight the innovative part of the present invention, which does not indicate that there are no other elements in the above-mentioned embodiments of the apparatus.
It is to be noted that in the claims and the description of the present patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the use of the verb "comprise a" to define an element does not exclude the presence of another, same element in a process, method, article, or apparatus that comprises the element.
While the invention has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (9)

1. A method of continuous data protection of a database, the database comprising a first database visible to a user and a second database invisible to a user, the second database delaying replication of the first database, the first database being the first database at a first time, the second database being the first database at a second time, the second time being delayed from the first time by a predetermined time period, the method comprising:
receiving an instruction to retrieve the first database at a third time;
updating the second database according to an instruction for retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
switching the updated second database to be visible to a user, or switching the updated second database to be a new first database;
wherein the second database is updated according to the incremental log between the third time and the second time.
2. The method of claim 1, wherein the first database is provided by a first computing node and the second database is provided by a second computing node, wherein the configuration of the second computing node is lower than the configuration of the first computing node when replication is delayed and wherein the configuration of the second computing node is higher than the configuration of the first computing node when updated.
3. The method of claim 2, wherein the configuration of the second computing node is lower than the configuration of the first computing node when delaying replication, and wherein the configuration of the second computing node is equal to the configuration of the first computing node when updating.
4. The method of claim 2, wherein the configuration of the second computing node is equal to the configuration of the first computing node when delaying replication, and wherein the configuration of the second computing node is higher than the configuration of the first computing node when updating.
5. The method of any of claims 2 to 4, wherein the configuration of the second computing node is equal to the configuration of the first computing node after updating.
6. The method according to claim 1, wherein the predetermined period of time is set according to a delay time setting instruction.
7. A system for continuous data protection of a database, the database comprising a first database visible to a user and a second database invisible to a user, the second database delaying replication of the first database, the first database being the first database at a first time, the second database being the first database at a second time, the second time being delayed from the first time by a predetermined time period, the system comprising:
a receiving module configured to receive an instruction to retrieve the first database at a third time;
an update module configured to update the second database according to an instruction to retrieve the first database at the third time, the updated second database being the first database at the third time, the third time being between the first time and the second time;
a switching module configured to switch the updated second database to be visible to a user or to switch the updated second database to be a new first database;
wherein the second database is updated according to the incremental log between the third time and the second time.
8. An apparatus for continuous data protection of a database, the apparatus comprising a memory storing computer executable instructions and a processor configured to execute the instructions to implement a method for continuous data protection of a database, the database comprising a first database visible to a user and a second database invisible to a user, the second database delaying replication of the first database, the first database being the first database at a first time, the second database being the first database at a second time, the second time being delayed from the first time by a predetermined time period, the method comprising:
receiving an instruction to retrieve the first database at a third time;
updating the second database according to an instruction for retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
switching the updated second database to be visible to a user, or switching the updated second database to be a new first database;
wherein the second database is updated according to the incremental log between the third time and the second time.
9. A computer storage medium encoded with a computer program, the computer program comprising instructions that are executable by one or more computers to implement a method of continuous data protection of a database, the database comprising a first database that is visible to a user and a second database that is not visible to a user, the second database delaying replication of the first database, the first database being the first database at a first time, the second database being the first database at a second time, the second time being delayed from the first time by a predetermined time period, the method comprising:
receiving an instruction to retrieve the first database at a third time;
updating the second database according to an instruction for retrieving the first database at the third time, wherein the updated second database is the first database at the third time, and the third time is between the first time and the second time;
switching the updated second database to be visible to a user, or switching the updated second database to be a new first database;
wherein the second database is updated according to the incremental log between the third time and the second time.
CN201910628979.XA 2019-07-12 2019-07-12 Continuous data protection method, system, device and medium for database Active CN110362429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910628979.XA CN110362429B (en) 2019-07-12 2019-07-12 Continuous data protection method, system, device and medium for database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910628979.XA CN110362429B (en) 2019-07-12 2019-07-12 Continuous data protection method, system, device and medium for database

Publications (2)

Publication Number Publication Date
CN110362429A CN110362429A (en) 2019-10-22
CN110362429B true CN110362429B (en) 2021-08-06

Family

ID=68219115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910628979.XA Active CN110362429B (en) 2019-07-12 2019-07-12 Continuous data protection method, system, device and medium for database

Country Status (1)

Country Link
CN (1) CN110362429B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102388361A (en) * 2009-04-03 2012-03-21 微软公司 Differential file and system restores from peers and the cloud
US8972353B1 (en) * 2011-12-02 2015-03-03 Emc Corporation System and method of enhanced backup and recovery configuration
CN109032849A (en) * 2018-08-30 2018-12-18 百度在线网络技术(北京)有限公司 Hot backup system, heat backup method and computer equipment
CN109871295A (en) * 2017-12-01 2019-06-11 北京金山云网络技术有限公司 A kind of data back up method, back-up device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9558078B2 (en) * 2014-10-28 2017-01-31 Microsoft Technology Licensing, Llc Point in time database restore from storage snapshots
CN109828950A (en) * 2019-01-29 2019-05-31 深圳前海达闼云端智能科技有限公司 Data protection method, management system, server and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102388361A (en) * 2009-04-03 2012-03-21 微软公司 Differential file and system restores from peers and the cloud
US8972353B1 (en) * 2011-12-02 2015-03-03 Emc Corporation System and method of enhanced backup and recovery configuration
CN109871295A (en) * 2017-12-01 2019-06-11 北京金山云网络技术有限公司 A kind of data back up method, back-up device, electronic equipment and storage medium
CN109032849A (en) * 2018-08-30 2018-12-18 百度在线网络技术(北京)有限公司 Hot backup system, heat backup method and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Docker的云存储服务系统设计与实现;马青纯,;《中国优秀硕士学位论文全文数据库信息科技辑(月刊)》;20170215(第02期);I138-2521 *

Also Published As

Publication number Publication date
CN110362429A (en) 2019-10-22

Similar Documents

Publication Publication Date Title
US20200142602A1 (en) Replication of versions of an object from a source storage to a target storage
US9489270B2 (en) Managing backup operations from a client system to a primary server and secondary server
US9697092B2 (en) File-based cluster-to-cluster replication recovery
CN106933501B (en) Method, system, and computer program product for creating a replica
EP3179359B1 (en) Data sending method, data receiving method, and storage device
KR101231563B1 (en) Real time data replication
CN103761165A (en) Log backup method and log backup device
US10831741B2 (en) Log-shipping data replication with early log record fetching
US20150213100A1 (en) Data synchronization method and system
CN103765406A (en) Methods and apparatus for remotely updating executing processes
EP3785120B1 (en) Fast and optimized restore using delta information
CN106919465B (en) Method and apparatus for multiple data protection in a storage system
US10628298B1 (en) Resumable garbage collection
US20190227710A1 (en) Incremental data restoration method and apparatus
RU2653254C1 (en) Method, node and system for managing data for database cluster
JP5868986B2 (en) Recovery by item
WO2017014814A1 (en) Replicating memory volumes
CN110825559A (en) Data processing method and equipment
US20150317373A1 (en) Volume initialization for asynchronous mirroring
US20160139996A1 (en) Methods for providing unified storage for backup and disaster recovery and devices thereof
CN111143113A (en) Method, electronic device and computer program product for copying metadata
CN110362429B (en) Continuous data protection method, system, device and medium for database
CN111143112B (en) Method, apparatus and computer readable storage medium for restoring metadata
CN115328696A (en) Data backup method in database
CN110673985B (en) Method for automatically backing up version library, storage medium and server

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
GR01 Patent grant
GR01 Patent grant