CN112559258A - Disaster recovery processing method, device, system, equipment and medium - Google Patents

Disaster recovery processing method, device, system, equipment and medium Download PDF

Info

Publication number
CN112559258A
CN112559258A CN202011404476.3A CN202011404476A CN112559258A CN 112559258 A CN112559258 A CN 112559258A CN 202011404476 A CN202011404476 A CN 202011404476A CN 112559258 A CN112559258 A CN 112559258A
Authority
CN
China
Prior art keywords
switching
storage database
request
target
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011404476.3A
Other languages
Chinese (zh)
Inventor
赵鹏昕
陈韬
王超将
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011404476.3A priority Critical patent/CN112559258A/en
Publication of CN112559258A publication Critical patent/CN112559258A/en
Pending legal-status Critical Current

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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2089Redundant storage control functionality
    • 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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space

Abstract

The embodiment of the disclosure relates to a disaster recovery processing method, a disaster recovery processing device, a disaster recovery processing system, equipment and a medium, wherein the method comprises the following steps: acquiring detection data of a main storage database for a data access request, and switching a target request corresponding to a target switching condition in the data access request to a heterogeneous backup storage database if the target switching condition is determined to be met based on the detection data; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests. By adopting the technical scheme, the read requests and the write requests in the data access requests can be respectively switched through the heterogeneous backup storage, the switching of the read requests of the main storage can be divided, the normal operation of the main storage is ensured, the stability is improved, and when the main storage fails, all the data access requests are switched, so that the failure recovery time is effectively reduced.

Description

Disaster recovery processing method, device, system, equipment and medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, a system, a device, and a medium for disaster recovery processing.
Background
At present, a plurality of disaster recovery schemes are in the mainstream, a plurality of remote computer rooms are common, data consistency between a main computer room and a standby computer room is ensured through a raw protocol, and when the main computer room fails, flow can be quickly switched to the standby computer room through a Domain Name System (DNS).
When the disaster recovery scheme based on multiple remote computer rooms is applied to an online service scene, disaster recovery is performed by setting main/standby storage, but the disaster recovery scheme has the defects that stable operation can only be ensured through lossy operation when the flow rate suddenly increases, other standby storage is easy to cause avalanche when one standby storage fails, and the unavailable time or recovery time after the main storage is shut down is long.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the present disclosure provides a disaster recovery processing method, apparatus, system, device, and medium.
The embodiment of the disclosure provides a disaster recovery processing method, which includes:
acquiring detection data of a main storage database for a data access request;
if the target switching condition is determined to be met based on the detection data, switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
The embodiment of the present disclosure further provides a disaster recovery processing method and device, where the device includes:
the detection data module is used for acquiring detection data of the main storage database for the data access request;
the switching module is used for switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database if the target switching condition is determined to be met based on the detection data; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
The embodiment of the present disclosure further provides a disaster recovery processing system, where the disaster recovery processing system includes a control center, and a main storage database and a heterogeneous backup storage database that are connected to the control center, and the control center is configured to execute the disaster recovery processing method provided in the embodiment of the present disclosure.
An embodiment of the present disclosure further provides an electronic device, which includes: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instruction from the memory and execute the instruction to implement the disaster recovery processing method according to the embodiment of the present disclosure.
The embodiment of the present disclosure also provides a computer-readable storage medium, where a computer program is stored, where the computer program is used to execute the disaster recovery processing method provided by the embodiment of the present disclosure.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: according to the disaster recovery processing method scheme provided by the embodiment of the disclosure, detection data of a main storage database for a data access request are acquired, and if it is determined that a target switching condition is met based on the detection data, a target request corresponding to the target switching condition in the data access request is switched to a heterogeneous backup storage database; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests. By adopting the technical scheme, the read requests and the write requests in the data access requests can be respectively switched through the heterogeneous backup storage, the switching of the read requests of the main storage can be divided, the normal operation of the main storage is ensured, the stability is improved, and when the main storage fails, all the data access requests are switched, so that the failure recovery time is effectively reduced.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a schematic flow chart of a disaster recovery processing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another disaster recovery processing method according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart of write request switching according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram after a write request is switched according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a disaster recovery processing system according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of disaster recovery processing according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a disaster recovery processing method and apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
At present, a plurality of disaster recovery schemes are in the mainstream, a plurality of remote computer rooms are common, data consistency between a main computer room and a standby computer room is ensured through a raw protocol, and when the main computer room fails, flow can be quickly switched to the standby computer room through a Domain Name System (DNS).
When the disaster recovery scheme based on multiple remote machine rooms is applied to an online service scene, disaster recovery is performed by setting main and standby storage, for example, a relational database MySQL is selected as bottom storage, and then disaster recovery is performed by the main and standby MySQL. Because the performance of the main MySQL is prior, the most schemes are a main framework with six standby devices, and because the performance of the main library is possibly affected by increasing the number of the standby libraries, disaster recovery by continuously increasing the number of the standby libraries is not recommended.
The disaster recovery scheme has the following defects: when an online sudden abnormal high flow comes, all read library pressure rises, a Service Level Agreement (SLA) declines, the SLA can represent the performance and the availability of a Service, and as the newly added backup libraries are cold backups and cannot resist the online flow through the rapidly added backup libraries, the stable operation of the database can be ensured only by performing a request fusing or degrading strategy on a Service, and the operation is damaged; when one standby database or one regional standby database is down, all the flow can be concentrated into the rest standby databases, and the existing standby databases can be avalanche because the rest hot standby data can not be stored in time; and when the main library is down, manual intervention of a Database Administrator (DBA) is often needed, so that the online unavailable time and recovery time are increased greatly. In view of the above problems, an embodiment of the present disclosure provides a disaster recovery processing method.
Fig. 1 is a schematic flow chart of a disaster recovery processing method according to an embodiment of the present disclosure, where the method may be executed by a disaster recovery processing method apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 1, the method is applied to a control center in a disaster recovery processing system, and includes:
step 101, acquiring detection data of a main storage database for a data access request.
The main storage database is a main storage in a service scene, and the main storage database may adopt various types of databases, which is described in the embodiment of the present disclosure by taking MySQL as an example. The data access request refers to a request for data access initiated by a user in a service scenario, and may include a read request and a write request, where the read request refers to a request for reading data, and the write request refers to a request for writing data. The detection data may be monitoring data for data access requests and may include various indicators, for example, the detection data may include a total number of data access requests, a number of errors for data access requests, a number of timeout for data access requests, and so on.
Specifically, the control center monitors the process of processing the data access request by the main storage database, and acquires the detection data of the main storage database for the data access request.
And 102, if the target switching condition is determined to be met based on the detection data, switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database.
The target switching condition may include a read switching condition and a write switching condition, the target request corresponds to the target switching condition, the target request corresponding to the read switching condition is a read request, and the target request corresponding to the write switching condition is a read request and a write request. In the embodiment of the disclosure, switching of the read request and the write request in the data access request is split, so that more flexible disaster recovery control can be realized.
The heterogeneous standby storage database is a standby database in a service scene, and completely different databases are adopted by the heterogeneous standby storage database and the main storage database, so that the mutual influence is small. The heterogeneous equipment storage database can also adopt various databases of different types, and an Abase database is taken as an example in the embodiment of the disclosure for explanation. The heterogeneous backup storage database is a hot backup, that is, when a write request is processed, a strategy of double writing in the main storage database and the heterogeneous backup storage database is adopted to ensure that incremental data are consistent, and the consistency of full data is ensured through consistency check and repair. Optionally, the heterogeneous backup storage database may further set a backup database according to an actual situation, so as to meet a service requirement of an actual scene.
In this embodiment of the disclosure, when the target switching condition is the read switching condition, determining that the target switching condition is satisfied based on the detection data may include: determining that a read switch condition is satisfied if a request failure rate of data access requests in the detected data is greater than or equal to a first failure rate threshold. The request failure rate of the data access request refers to a ratio of a sum of a number of errors of the data access request and a number of timeout to a total number of the data access requests within a period of time, and the period of time may be set according to an actual situation, for example, the period of time may be 10 minutes. The first failure rate threshold is a threshold corresponding to a request failure rate of the data access request, and may be set in advance. After the detection data is acquired, the request failure rate of the data access request in the detection can be compared with the first failure rate threshold, and if the request failure rate of the data access request is greater than or equal to the first failure rate threshold, it can be determined that the read switching condition is met, and the read request is shunted.
Optionally, switching a target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database may include: and switching the read request in the data access request to the heterogeneous backup storage database by dynamically adjusting the flow proportion within a set time. The flow proportion is a value of the number of the read requests in the data access requests sent to the heterogeneous backup storage database accounting for the total number of the read requests. The set time is a process expected time for switching the read request, that is, it is desirable to switch all the read requests within the set time, and the set time may be set according to an actual situation, for example, the set time may be 20 seconds. Optionally, a switching template may be preset, where the switching template is provided with a set time and a flow ratio interval, for example, one switching template may include setting the time to be 30 seconds and the flow ratio interval to be 50%, and switching the read request at 50% of the flow ratio interval in 30 seconds. When the read switching condition is met, the read request can be switched to the heterogeneous storage database by dynamically adjusting the flow proportion from small to large within a set time. For example, the flow rate ratio may be adjusted from 50% to 100% within 20 seconds, and the switching of the read request may be completed.
In the embodiment of the disclosure, the switching of the read request may be performed automatically or by manually controlling the read degradation, the manual priority is higher than the automatic priority, when the reading is performed manually, the control center may provide a console page to the user, the console page may provide a manual policy enabling switch and a traffic switching flow operation interface, the traffic switching flow operation interface may include a traffic switching process configuration interface and a traffic switching process switch, the selection and configuration of the switching template may be performed in the traffic switching process configuration interface, and the switching may be started, stopped, and rolled back through the traffic switching process switch. In the embodiment of the present disclosure, the switching of the read request in the data access request may be performed step by step according to a ratio, that is, the read request is not all switched to the heterogeneous backup storage database at one time, so that a sudden change of the read flow rate can be avoided, and no perception can be realized in service, thereby ensuring normal operation of the main storage database.
In this embodiment of the disclosure, when the target switching condition is the write switching condition, determining that the target switching condition is satisfied based on the detection data may include: and if the request failure rate of the write requests in the data access requests in the detected data is greater than or equal to the second failure rate threshold value, determining that the write switching condition is met. The request failure rate of the write requests in the data access requests refers to a ratio of the sum of the number of errors of the write requests and the number of overtime to the total number of the write requests within a period of time, and the period of time can be set according to actual conditions. The second failure rate threshold is a threshold corresponding to a request failure rate of a write request of the data access request, and may be set in advance. After the detection data is acquired, the request failure rate of the write request in the data access request under detection may be compared with the second failure rate threshold, and if the request failure rate of the write request is greater than or equal to the second failure rate threshold, it indicates that an abnormal condition such as downtime or failure may occur in the main storage database, and it may be determined that the write switching condition is satisfied, and the read request and the write request are switched.
Optionally, switching a target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database may include: after the read request in the data access request is switched to the heterogeneous backup storage database in full, judging whether the write switching condition is met again; and if the write switching condition is determined to be met again, switching the write request in the data access requests to the heterogeneous storage database in a full amount. After the write switching condition is met, the read request needs to be switched before the write request is switched, after the read request is switched to the heterogeneous backup storage database in a full amount, the detection data can be obtained again, whether the write switching condition is met again is judged, and if the write request meets the write switching condition again, the write request in the full amount is switched to the heterogeneous backup storage database. The switching of write requests is full.
In the disclosed embodiment, the switching of the write request is a lossy operation, which may affect the downstream binlog log snooping and may also affect the processing (dump) of offline data if it is across days. Therefore, after the read request is switched, whether the problem is solved is judged by judging whether the write switching condition is met again, if the write switching condition is not met, the problem is solved, the write request is not switched, and the lossy operation can be avoided as much as possible.
According to the disaster recovery processing method scheme provided by the embodiment of the disclosure, detection data of a main storage database for a data access request are acquired, and if it is determined that a target switching condition is met based on the detection data, a target request corresponding to the target switching condition in the data access request is switched to a heterogeneous backup storage database; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests. By adopting the technical scheme, the read requests and the write requests in the data access requests can be respectively switched through the heterogeneous backup storage, the switching of the read requests of the main storage can be divided, the normal operation of the main storage is ensured, the stability is improved, and when the main storage fails, all the data access requests are switched, so that the failure recovery time is effectively reduced.
In some embodiments, after the switching the write request in the data access request to the heterogeneous backup storage database in full, the method may further include: receiving a repair completion instruction of the main storage database, and simultaneously writing the incremental data into the repaired main storage database and the repaired heterogeneous backup storage database through the consistency increment assembly; and synchronizing the data in the heterogeneous backup storage database to the repaired main storage database through the consistency full component.
The consistency increment component refers to a component for synchronizing incremental data, and the consistency full component refers to a component for realizing the consistency of stock data, namely full data. In the embodiment of the disclosure, after the write request is switched, the main storage database is not updated any more, the main storage database is updated to the heterogeneous backup storage database in a full amount, and a database administrator can be contacted to repair the main storage database subsequently. After the main storage database is modified, a modification completion instruction of the main storage database sent by a database administrator can be received, double writing of the repaired main storage database and the repaired heterogeneous backup storage database is performed through the consistency increment component to ensure consistency of the increment data, and reverse data repair from the heterogeneous backup storage database to the modified main storage database, namely synchronization of full data, can be performed through the consistency full component.
After the main storage database is repaired, the data of the repaired main storage database can be ensured to be the same as the data of the heterogeneous backup storage database through double writing and repairing, so that the subsequent recovery of the main storage database is facilitated, and the data access requests are completely switched back.
In some embodiments, the disaster recovery processing method in the embodiments of the present disclosure may further include: switching the write request in the data access request to the repaired main storage database in full; and switching the read request in the data access request to the repaired main storage database step by dynamically adjusting the flow proportion.
After the data in the repaired main storage database is synchronized, the switch for switching the write requests can be turned off, that is, the write requests are all switched to the repaired main storage database, and then the read requests can be gradually switched to the repaired main storage database by dynamically adjusting the flow rate proportion. The method has the advantages that the read request and the write request can be switched back to the repaired main storage database to restore the normal state, and the read request is switched step by step, so that the repaired main storage database is prevented from being punctured due to sudden traffic change.
In some embodiments, after determining that the target handover condition is satisfied based on the detection data, the method may further include: and detecting the consistency rate of the main storage database and the heterogeneous backup storage database, and executing switching of a target request corresponding to a target switching condition in the data access requests to the heterogeneous backup storage database when the consistency rate is greater than or equal to a consistency rate threshold value.
In the embodiment of the disclosure, before switching of the target request, the consistency rate or consistency of the data of the main storage database and the heterogeneous backup storage database can be detected through the consistency full component, and if the consistency rate is greater than or equal to the consistency rate threshold, switching can be performed; if the consistency rate is less than the consistency rate threshold, the repair can be performed until the consistency rate is greater than or equal to the consistency rate threshold, and then the switching is performed. The consistency rate threshold may be set according to actual conditions, for example, the consistency rate threshold may be 99.9%, that is, the maximum of 100 data of 10 ten thousand data are different. Before switching of the data access request, consistency of the main data and the standby data can be ensured by increasing the consistency rate detection, and further accuracy of the data access request is improved.
In some embodiments, the disaster recovery processing method in the embodiments of the present disclosure may further include: acquiring detection data of a main cache database for a data access request; and if the read switching condition or the write switching condition is determined to be met based on the detection data, switching the read request or the write request in the data access request to the homogeneous cache database. Besides the storage layer, a cache layer can be set in the service scene, and the cache layer can also set a main and standby cache database for disaster recovery processing. The standby cache database in the embodiment of the present disclosure may be a homogeneous standby cache database that is the same as the main cache database, for example, both the main cache database and the homogeneous standby cache database may adopt a Redis database.
The read switching condition corresponds to a read request and the write switching condition corresponds to a write request. Acquiring detection data of the main cache database for the data access request, determining that a read switching condition is met if the failure rate of the read request in the detection data is greater than a third failure rate threshold value, switching a part of the read request to the isomorphic cache database, and reducing the pressure of the main cache database; and if the failure rate of the write request in the monitored data is greater than the third failure rate threshold value, determining that the write switching condition is met, and switching the write request to the isomorphic cache database. The third failure rate threshold and the fourth failure rate threshold may be set according to actual conditions.
When the cache layer is disaster-tolerant, the switching of the read request and the write request can be separated, so that more flexible disaster-tolerant control is realized, and the stability of service is improved.
Fig. 2 is a schematic flow chart of another disaster recovery processing method according to an embodiment of the present disclosure, and the embodiment further optimizes the disaster recovery processing method based on the above embodiment. As shown in fig. 2, the method includes:
step 201, acquiring detection data of the main storage database for the data access request.
Step 202, determining whether a target switching condition is met or not based on the detection data, if yes, executing step 203; otherwise, return to execute step 201.
The target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
In this embodiment of the disclosure, when the target switching condition is the read switching condition, determining that the target switching condition is satisfied based on the detection data may include: determining that a read switch condition is satisfied if a request failure rate of data access requests in the detected data is greater than or equal to a first failure rate threshold. Optionally, when the target switching condition is the write switching condition, determining that the target switching condition is satisfied based on the detection data may include: and if the request failure rate of the write requests in the data access requests in the detected data is greater than or equal to the second failure rate threshold value, determining that the write switching condition is met.
And step 203, detecting the consistency rate of the main storage database and the heterogeneous backup storage database.
Step 204, judging whether the consistency rate is greater than or equal to a consistency rate threshold value, if so, executing step 205; otherwise, return to execute step 203.
Judging whether the consistency rate is greater than or equal to a consistency rate threshold value through a consistency full component, if so, executing a step 205; otherwise, the consistency repair of the main storage database and the heterogeneous backup storage database can be performed, and the step 203 is executed.
And step 205, switching a target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database.
In this embodiment of the present disclosure, when the target switching condition is a read switching condition, the target request is a read request, and the switching the target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database may include: and switching the read request in the data access request to the heterogeneous backup storage database by dynamically adjusting the flow proportion within a set time. The flow proportion is a value of the number of the read requests in the data access requests sent to the heterogeneous backup storage database accounting for the total number of the read requests. When the target switching condition is a write switching condition, the target request is a read request and a write request, and the switching of the target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database may include: after the read request in the data access request is switched to the heterogeneous backup storage database in full, judging whether the write switching condition is met again; and if the write switching condition is determined to be met again, switching the write request in the data access requests to the heterogeneous storage database in a full amount.
Optionally, after the full amount of write requests in the data access request is switched to the heterogeneous backup storage database, the method may further include: receiving a repair completion instruction of the main storage database, and simultaneously writing the incremental data into the repaired main storage database and the repaired heterogeneous backup storage database through the consistency increment assembly; and synchronizing the data in the heterogeneous backup storage database to the repaired main storage database through the consistency full component. Optionally, the disaster recovery processing method may further include: switching the write request in the data access request to the repaired main storage database in full; and switching the read request in the data access request to the repaired main storage database step by dynamically adjusting the flow proportion.
Exemplarily, fig. 3 is a schematic flow diagram of write request switching provided by an embodiment of the present disclosure, and fig. 4 is a schematic structural diagram of a switched write request provided by an embodiment of the present disclosure, referring to fig. 3, after 100% of read-through, that is, after the read request is switched to the heterogeneous backup storage database in full; turning on a cut-write switch, and switching the whole write request to the heterogeneous backup storage database, referring to fig. 4, wherein all the read request and the write request are sent to the heterogeneous backup storage database; determining the condition of MySQL writing database with DBA, namely determining whether the main storage database is repaired or not with a database administrator; after the main storage database is repaired, double writing can be opened, as shown in fig. 4, double writing to the repaired main storage database and the heterogeneous backup storage database is realized through the consistency increment component, and consistency of increment data is ensured; observing the error rate of the MySQL write database through a consistency full component, namely judging whether the full data of the main storage database and the heterogeneous backup storage database are consistent; repairing MySQL data by the DataEyes, as shown in FIG. 4, wherein the DataEyes is a consistency full component, and the consistency of the full data of the main storage database and the heterogeneous backup storage database is ensured through repairing; closing the cut-write switch, and switching the request to the repaired main storage database in full; slowly reading the normal state, and gradually switching the read request to the repaired main storage database through dynamically adjusting the flow proportion; the cache hit rate can be observed in the read request switching process, so that the main storage database after repair can be prevented from being punched through by fast switching.
According to the disaster recovery processing method scheme provided by the embodiment of the disclosure, detection data of a main storage database for a data access request is acquired, if it is determined that a target switching condition is met based on the detection data, a consistency rate of the main storage database and a heterogeneous backup storage database is detected, and if the consistency rate is greater than or equal to a consistency rate threshold value, a target request corresponding to the target switching condition in the data access request is switched to the heterogeneous backup storage database. By adopting the technical scheme, the read requests and the write requests in the data access requests can be respectively switched through the heterogeneous backup storage, the switching of the read requests of the main storage can be divided, the normal operation of the main storage is ensured, the stability is improved, and when the main storage fails, all the data access requests are switched, so that the failure recovery time is effectively reduced.
Fig. 5 is a schematic structural diagram of a disaster recovery processing system according to an embodiment of the present disclosure, where the disaster recovery processing system may include a control center 51, and a main storage database 52 and a heterogeneous backup storage database 53 connected to the control center 51, where the control center 51 is configured to execute the disaster recovery processing method according to the embodiment of the present disclosure, acquire detection data of the main storage database 52 for a data access request, and switch a target request corresponding to a target switching condition in the data access request to the heterogeneous backup storage database 53 if it is determined that the target switching condition is met based on the detection data; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
In the embodiment of the present disclosure, the disaster recovery processing system may further include a main cache database 54 and a homogeneous backup cache database 55 connected to the control center 51, and a consistency component connected to the control center 51, where the consistency component includes a consistency full component 57 and a consistency increment component 56.
Fig. 6 is a schematic diagram of a disaster recovery process provided in the embodiment of the present disclosure, as shown in fig. 6, a disaster recovery of a cache layer is implemented by using a main cache database 54 and an isomorphic backup cache database 55, both the main cache database 54 and the isomorphic backup cache database 55 may be Redis databases, and in a read flow, a bypass detection flow in a certain proportion is used to perform a dotting statistic on availability and accuracy of the isomorphic backup cache database 55, that is, the availability and data accuracy are determined by determining whether a request failure rate of a read request by the isomorphic backup cache database 55 is greater than a threshold; when the read failure amount of the main cache database 54 is too large, a part of the traffic can be cut into the homogeneous cache database 55, so that the pressure of the main cache database 54 is reduced; in the write flow, a double-write strategy is adopted to ensure that the homogeneous standby cache database 55 is always in a hot standby state, and the main-standby switching can be performed after the write failure amount of the main cache database 54 is too large.
As shown in fig. 6, the disaster tolerance of the storage layer is implemented by using a main storage database 52 and a heterogeneous backup storage database 53, the main storage database 52 may be a MySQL database, the heterogeneous backup storage database 53 may be an Abase database, and in the read flow, a certain proportion of bypass detection flow is used to perform a dotting statistic on the availability and accuracy of the heterogeneous backup storage database 53, that is, the availability and data accuracy are determined by determining whether the request failure rate of the heterogeneous backup storage database 53 for the read request is greater than a threshold value; when the main storage database 52 fails to read, the data can be proportionally sent back to the heterogeneous storage database 53; in the write flow, a strategy of double writing at the bottom layer is adopted to ensure that the incremental data of the heterogeneous backup storage database 53 is consistent with the main storage database 52, when the main storage database 52 fails to write, the heterogeneous backup storage database 53 is switched to, and when the main storage database 52 is recovered, the double writing of the main storage database 52 is required to be firstly carried out, then the MySQL data is required to be repaired, and finally the main storage database 52 is switched back continuously. The consistency of the stock data in the main storage database 52 and the heterogeneous backup storage database 53 is ensured to be realized through a consistency full component (DataEyes)57, when the bypass detection flow finds that the data inconsistency rate is too large, all data in the main storage database 52 can be repaired by covering the heterogeneous backup storage database 53 with the data, that is, the data consistency check and repair are realized through the consistency full component 57; the synchronization of incremental data from the primary storage database 52 to the heterogeneous storage database 53 is implemented by a consistency increment component (DB Mirror)56, and the bottom layer is double-written by a switch.
The disaster recovery processing system in the embodiment of the disclosure constructs heterogeneous storage, ensures the state of the hot standby for a long time by the heterogeneous storage, and can achieve the situation of resisting the abnormal situation in a dynamic flow switching manner; through the cooperation among each module in the disaster recovery processing system, have following beneficial effect: for the problems of increased database pressure and reduced availability caused by cache penetration, heterogeneous hot standby storage can be well shunted, so that normal operation of main storage is guaranteed, shunting can be performed proportionally and slowly, flow mutation does not exist, and business cannot be sensed; for the condition that partial storage is down, the flow is pressurized into the rest of the storages, and the flow can be dynamically adjusted into heterogeneous hot standby storage to ensure the stability of the existing system; for the condition that the main library is down, a write-over strategy can be carried out, heterogeneous storage is used as main storage through a switch, and the accident recovery time is effectively shortened.
Fig. 7 is a schematic structural diagram of a disaster recovery processing method and apparatus provided in an embodiment of the present disclosure, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 7, the apparatus includes:
the detection data module 601 is configured to obtain detection data of the main storage database for the data access request;
a switching module 602, configured to switch, if it is determined, based on the detection data, that a target switching condition is met, a target request, which is in the data access request and corresponds to the target switching condition, to a heterogeneous storage database; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
Optionally, when the target switching condition is a read switching condition, the switching module 602 includes a switching determining unit, and the switching determining unit is specifically configured to: determining that the read switch condition is satisfied if a request failure rate of the data access requests in the detection data is greater than or equal to a first failure rate threshold.
Optionally, the switching module 602 includes a switching execution unit, and the switching execution unit is specifically configured to:
and switching the read request in the data access request to a heterogeneous backup storage database by dynamically adjusting the flow proportion within a set time.
Optionally, the traffic proportion is a value of the total number of read requests sent by the read requests in the data access requests to the heterogeneous backup storage database.
Optionally, when the target switching condition is a write switching condition, the switching determining unit is specifically configured to:
and if the request failure rate of the write request in the data access request in the detection data is greater than or equal to a second failure rate threshold value, determining that the write switching condition is met.
Optionally, the handover performing unit is specifically configured to:
after the read request in the data access request is switched to a heterogeneous backup storage database in a full amount, judging whether the write switching condition is met again;
and if the write switching condition is determined to be met again, switching the whole write requests in the data access requests to the heterogeneous backup storage database.
Optionally, the apparatus further includes a repair module, specifically configured to: after the write request in the data access request is switched to the heterogeneous storage database in full,
receiving a repair completion instruction of the main storage database, and simultaneously writing incremental data into the repaired main storage database and the heterogeneous backup storage database through a consistency increment assembly;
and synchronizing the data in the heterogeneous backup storage database to the repaired main storage database through a consistency full component.
Optionally, the apparatus further includes a repair switching module, specifically configured to:
switching the write request in the data access request to the repaired main storage database in full;
and gradually switching the read request in the data access request to the repaired main storage database by dynamically adjusting the flow proportion.
Optionally, the apparatus further includes a coincidence module, specifically configured to: after determining that a target handover condition is satisfied based on the detection data,
and detecting the consistency rate of the main storage database and the heterogeneous backup storage database, and executing the switching of the target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database when the consistency rate is greater than or equal to a consistency rate threshold value.
Optionally, the apparatus further includes a cache switching module, specifically configured to:
acquiring detection data of a main cache database for a data access request;
and if the read switching condition or the write switching condition is determined to be met based on the detection data, switching the read request or the write request in the data access request to a homogeneous preparation cache database.
The disaster recovery processing method and device provided by the embodiments of the present disclosure can execute the disaster recovery processing method provided by any embodiment of the present disclosure, and have the corresponding functional modules and beneficial effects of the execution method.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring now specifically to fig. 8, a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 700 in the disclosed embodiment may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. When executed by the processing device 701, the computer program executes the above-described functions defined in the disaster recovery processing method according to the embodiment of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring detection data of a main storage database for a data access request; if the target switching condition is determined to be met based on the detection data, switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, the present disclosure provides a disaster recovery processing method, including:
acquiring detection data of a main storage database for a data access request;
if the target switching condition is determined to be met based on the detection data, switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
According to one or more embodiments of the present disclosure, in the disaster recovery processing method provided by the present disclosure, when the target handover condition is a read handover condition, the determining that the target handover condition is satisfied based on the detection data includes:
determining that the read switch condition is satisfied if a request failure rate of the data access requests in the detection data is greater than or equal to a first failure rate threshold.
According to one or more embodiments of the present disclosure, in the disaster recovery processing method provided by the present disclosure, switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database includes:
and switching the read request in the data access request to a heterogeneous backup storage database by dynamically adjusting the flow proportion within a set time.
According to one or more embodiments of the present disclosure, in the disaster recovery processing method provided by the present disclosure, the traffic proportion is a value in which the number of read requests in the data access requests sent to the heterogeneous backup storage database accounts for the total number of the read requests.
According to one or more embodiments of the present disclosure, in the disaster recovery processing method provided by the present disclosure, when the target switching condition is a write switching condition, the determining that the target switching condition is satisfied based on the detection data includes:
and if the request failure rate of the write request in the data access request in the detection data is greater than or equal to a second failure rate threshold value, determining that the write switching condition is met.
According to one or more embodiments of the present disclosure, in the disaster recovery processing method provided by the present disclosure, switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database includes:
after the read request in the data access request is switched to a heterogeneous backup storage database in a full amount, judging whether the write switching condition is met again;
and if the write switching condition is determined to be met again, switching the whole write requests in the data access requests to the heterogeneous backup storage database.
According to one or more embodiments of the present disclosure, after the switching the total write requests in the data access requests to the heterogeneous backup storage database, the method further includes:
receiving a repair completion instruction of the main storage database, and simultaneously writing incremental data into the repaired main storage database and the heterogeneous backup storage database through a consistency increment assembly;
and synchronizing the data in the heterogeneous backup storage database to the repaired main storage database through a consistency full component.
According to one or more embodiments of the present disclosure, the disaster recovery processing method further includes:
switching the write request in the data access request to the repaired main storage database in full;
and gradually switching the read request in the data access request to the repaired main storage database by dynamically adjusting the flow proportion.
According to one or more embodiments of the present disclosure, after determining that a target handover condition is satisfied based on the detection data, the method for processing disaster recovery further includes:
and detecting the consistency rate of the main storage database and the heterogeneous backup storage database, and executing the switching of the target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database when the consistency rate is greater than or equal to a consistency rate threshold value.
According to one or more embodiments of the present disclosure, the disaster recovery processing method further includes:
acquiring detection data of a main cache database for a data access request;
and if the read switching condition or the write switching condition is determined to be met based on the detection data, switching the read request or the write request in the data access request to a homogeneous preparation cache database.
According to one or more embodiments of the present disclosure, there is provided a disaster recovery processing apparatus including:
the detection data module is used for acquiring detection data of the main storage database for the data access request;
the switching module is used for switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database if the target switching condition is determined to be met based on the detection data; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
According to one or more embodiments of the present disclosure, in the disaster recovery processing device provided by the present disclosure, when the target switching condition is a read switching condition, the switching module includes a switching determination unit, and the switching determination unit is specifically configured to: determining that the read switch condition is satisfied if a request failure rate of the data access requests in the detection data is greater than or equal to a first failure rate threshold.
According to one or more embodiments of the present disclosure, in the disaster recovery processing device provided by the present disclosure, the switching module includes a switching execution unit, and the switching execution unit is specifically configured to:
and switching the read request in the data access request to a heterogeneous backup storage database by dynamically adjusting the flow proportion within a set time.
According to one or more embodiments of the present disclosure, in the disaster recovery processing device provided by the present disclosure, the traffic proportion is a value in which the number of read requests in the data access requests sent to the heterogeneous backup storage database accounts for the total number of read requests.
According to one or more embodiments of the present disclosure, in the disaster recovery processing device provided by the present disclosure, when the target switching condition is a write switching condition, the switching determination unit is specifically configured to:
and if the request failure rate of the write request in the data access request in the detection data is greater than or equal to a second failure rate threshold value, determining that the write switching condition is met.
According to one or more embodiments of the present disclosure, in the disaster recovery processing device provided by the present disclosure, the switching execution unit is specifically configured to:
after the read request in the data access request is switched to a heterogeneous backup storage database in a full amount, judging whether the write switching condition is met again;
and if the write switching condition is determined to be met again, switching the whole write requests in the data access requests to the heterogeneous backup storage database.
According to one or more embodiments of the present disclosure, in the disaster recovery processing apparatus provided by the present disclosure, the apparatus further includes a repair module, specifically configured to: after the write request in the data access request is switched to the heterogeneous storage database in full,
receiving a repair completion instruction of the main storage database, and simultaneously writing incremental data into the repaired main storage database and the heterogeneous backup storage database through a consistency increment assembly;
and synchronizing the data in the heterogeneous backup storage database to the repaired main storage database through a consistency full component.
According to one or more embodiments of the present disclosure, in the disaster recovery processing apparatus provided by the present disclosure, the apparatus further includes a repair switching module, specifically configured to:
switching the write request in the data access request to the repaired main storage database in full;
and gradually switching the read request in the data access request to the repaired main storage database by dynamically adjusting the flow proportion.
According to one or more embodiments of the present disclosure, in the disaster recovery processing apparatus provided by the present disclosure, the apparatus further includes a coincidence module, specifically configured to: after determining that a target handover condition is satisfied based on the detection data,
and detecting the consistency rate of the main storage database and the heterogeneous backup storage database, and executing the switching of the target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database when the consistency rate is greater than or equal to a consistency rate threshold value.
According to one or more embodiments of the present disclosure, in the disaster recovery processing apparatus provided by the present disclosure, the apparatus further includes a cache switching module, which is specifically configured to:
acquiring detection data of a main cache database for a data access request;
and if the read switching condition or the write switching condition is determined to be met based on the detection data, switching the read request or the write request in the data access request to a homogeneous preparation cache database.
According to one or more embodiments of the present disclosure, the present disclosure provides a disaster recovery processing system, including a control center, and a main storage database and a heterogeneous backup storage database connected to the control center, where the control center is configured to execute any of the disaster recovery processing methods provided by the present disclosure.
According to one or more embodiments of the present disclosure, the disaster recovery processing system further includes a primary cache database and a homogeneous backup cache database connected to the control center, and a consistency component connected to the control center, where the consistency component includes a consistency full component and a consistency increment component.
In accordance with one or more embodiments of the present disclosure, there is provided an electronic device including:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement any of the disaster recovery processing methods provided in the present disclosure.
According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing any one of the disaster recovery processing methods provided by the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (15)

1. A disaster recovery processing method is characterized by comprising the following steps:
acquiring detection data of a main storage database for a data access request;
if the target switching condition is determined to be met based on the detection data, switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
2. The method of claim 1, wherein when the target switching condition is a read switching condition, the determining that the target switching condition is satisfied based on the detection data comprises:
determining that the read switch condition is satisfied if a request failure rate of the data access requests in the detection data is greater than or equal to a first failure rate threshold.
3. The method of claim 2, wherein switching a target request of the data access requests corresponding to the target switching condition to a heterogeneous backup storage database comprises:
and switching the read request in the data access request to a heterogeneous backup storage database by dynamically adjusting the flow proportion within a set time.
4. The method of claim 3, wherein the traffic proportion is a value of a number of read requests in the data access requests sent to the heterogeneous storage database to a total number of the read requests.
5. The method of claim 1, wherein when the target switching condition is a write switching condition, the determining that the target switching condition is satisfied based on the detection data comprises:
and if the request failure rate of the write request in the data access request in the detection data is greater than or equal to a second failure rate threshold value, determining that the write switching condition is met.
6. The method of claim 5, wherein switching a target request of the data access requests corresponding to the target switching condition to a heterogeneous backup storage database comprises:
after the read request in the data access request is switched to a heterogeneous backup storage database in a full amount, judging whether the write switching condition is met again;
and if the write switching condition is determined to be met again, switching the whole write requests in the data access requests to the heterogeneous backup storage database.
7. The method of claim 6, wherein after switching the full number of write requests in the data access request to the heterogeneous storage database, further comprising:
receiving a repair completion instruction of the main storage database, and simultaneously writing incremental data into the repaired main storage database and the heterogeneous backup storage database through a consistency increment assembly;
and synchronizing the data in the heterogeneous backup storage database to the repaired main storage database through a consistency full component.
8. The method of claim 7, further comprising:
switching the write request in the data access request to the repaired main storage database in full;
and gradually switching the read request in the data access request to the repaired main storage database by dynamically adjusting the flow proportion.
9. The method of claim 1, wherein after determining that a target handover condition is satisfied based on the detection data, further comprising:
and detecting the consistency rate of the main storage database and the heterogeneous backup storage database, and executing the switching of the target request corresponding to the target switching condition in the data access request to the heterogeneous backup storage database when the consistency rate is greater than or equal to a consistency rate threshold value.
10. The method of claim 1, further comprising:
acquiring detection data of a main cache database for a data access request;
and if the read switching condition or the write switching condition is determined to be met based on the detection data, switching the read request or the write request in the data access request to a homogeneous preparation cache database.
11. A disaster recovery processing apparatus, comprising:
the detection data module is used for acquiring detection data of the main storage database for the data access request;
the switching module is used for switching a target request corresponding to the target switching condition in the data access request to a heterogeneous backup storage database if the target switching condition is determined to be met based on the detection data; the target switching conditions comprise read switching conditions and write switching conditions, target requests corresponding to the read switching conditions are read requests, and target requests corresponding to the write switching conditions are read requests and write requests.
12. A disaster recovery processing system, comprising a control center, and a main storage database and a heterogeneous backup storage database connected to the control center, wherein the control center is configured to execute the disaster recovery processing method according to any one of claims 1 to 10.
13. The disaster recovery processing system of claim 11, further comprising a primary cache database and a homogeneous backup cache database coupled to the control center, and a consistency component coupled to the control center, the consistency component comprising a consistency full component and a consistency delta component.
14. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the disaster recovery processing method according to any one of claims 1 to 10.
15. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the disaster recovery processing method according to any one of claims 1 to 10.
CN202011404476.3A 2020-12-02 2020-12-02 Disaster recovery processing method, device, system, equipment and medium Pending CN112559258A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011404476.3A CN112559258A (en) 2020-12-02 2020-12-02 Disaster recovery processing method, device, system, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011404476.3A CN112559258A (en) 2020-12-02 2020-12-02 Disaster recovery processing method, device, system, equipment and medium

Publications (1)

Publication Number Publication Date
CN112559258A true CN112559258A (en) 2021-03-26

Family

ID=75048460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011404476.3A Pending CN112559258A (en) 2020-12-02 2020-12-02 Disaster recovery processing method, device, system, equipment and medium

Country Status (1)

Country Link
CN (1) CN112559258A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117349088A (en) * 2023-12-04 2024-01-05 深圳市科力锐科技有限公司 Database increment back-cut method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062731A (en) * 2018-07-16 2018-12-21 阿里巴巴集团控股有限公司 Idempotent control method and device when a kind of database switches
US20200110542A1 (en) * 2018-10-06 2020-04-09 International Business Machines Corporation DYNAMIC I/O LOAD BALANCING FOR zHYPERLINK
CN111190538A (en) * 2019-12-20 2020-05-22 北京淇瑀信息科技有限公司 File storage method, system, device and computer readable medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062731A (en) * 2018-07-16 2018-12-21 阿里巴巴集团控股有限公司 Idempotent control method and device when a kind of database switches
US20200110542A1 (en) * 2018-10-06 2020-04-09 International Business Machines Corporation DYNAMIC I/O LOAD BALANCING FOR zHYPERLINK
CN111190538A (en) * 2019-12-20 2020-05-22 北京淇瑀信息科技有限公司 File storage method, system, device and computer readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117349088A (en) * 2023-12-04 2024-01-05 深圳市科力锐科技有限公司 Database increment back-cut method, device, equipment and storage medium
CN117349088B (en) * 2023-12-04 2024-04-02 深圳市科力锐科技有限公司 Database increment back-cut method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107295080B (en) Data storage method applied to distributed server cluster and server
EP3493471B1 (en) Data disaster recovery method, apparatus and system
CN105718570B (en) Data migration method and device for database
CN109951331B (en) Method, device and computing cluster for sending information
US9680692B2 (en) Method and system for using a recursive event listener on a node in hierarchical data structure
CN110597910A (en) Remote data synchronization method, device and system
CN106487486B (en) Service processing method and data center system
US10489378B2 (en) Detection and resolution of conflicts in data synchronization
US20130297563A1 (en) Timestamp management method for data synchronization and terminal therefor
CN115562911B (en) Virtual machine data backup method, device, system, electronic equipment and storage medium
US10782913B2 (en) Apparatus, method, and program product for data integrity during asynchronous remote copy
CN112486956A (en) Data access method and device and electronic equipment
CN110633046A (en) Storage method and device of distributed system, storage equipment and storage medium
CN112559258A (en) Disaster recovery processing method, device, system, equipment and medium
CN112929438B (en) Business processing method and device of double-site distributed database
CN112600690B (en) Configuration data synchronization method, device, equipment and storage medium
CN113760503A (en) Task migration method and device, electronic equipment and computer readable medium
CN110795495A (en) Data processing method and device, electronic equipment and computer readable medium
CN115102862A (en) Automatic synchronization method and device for SDN equipment
WO2020147415A1 (en) Snapshot service process management method and apparatus, electronic device, and readable storage medium
US20190324869A1 (en) Method, device and computer readable medium for data synchronization
US11500579B1 (en) Consolidated write system and method
CN112235332A (en) Read-write switching method and device for cluster
CN115037745B (en) Method and device for electing in distributed system
US11137925B2 (en) System and method for dynamically determining and non-disruptively re-balancing memory reclamation memory pools

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