Disaster recovery system, method and device for realizing global service component

By introducing global service components and regional data storage components into the disaster recovery system, using consistent protocols and asynchronous replication technology, the problem that disaster recovery solutions in the existing technology cannot meet service performance and data reliability at the same time, and efficient data replication and storage are achieved.

CN114625573BActive Publication Date: 2025-05-02ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210313309.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-05-02
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

Existing disaster recovery solutions have shortcomings in improving service performance and ensuring data reliability, especially in the event of service outages, where performance and reliability requirements cannot be met at the same time.

Method used

A disaster recovery system is designed, including a global service component and a regional data storage component. The global service component receives data write requests, writes data in the internal storage area based on the consistency protocol, and then synchronizes asynchronously to the regional data storage component.

Benefits of technology

Through the consistent protocol storage within the global service component, data reliability is ensured, and the write performance of regional data storage components is improved through asynchronous replication, meeting the dual needs of data reliability and service performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625573B_ABST
    Figure CN114625573B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a disaster recovery system, a method and an apparatus for implementing a global service component, wherein the system includes: the global service component is configured to receive a data write request, write the data carried by the data write request into the internal storage area of ​​the global service component based on a consistency protocol, and synchronize the data in the internal storage area to the regional data storage component. The regional data storage component is configured to provide read / write services and synchronize data in the regional data storage component through the global service component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a disaster recovery system, a method and an apparatus for implementing a global service component. Background Art

[0002] In a big data service system, services can be provided by multiple regions (or areas). In order to improve service performance, it is necessary to achieve fast local access with low latency in each region, and at the same time, it is necessary to ensure disaster recovery capabilities when service interruptions occur in the region. Therefore, disaster recovery solutions are a key part of big data service systems.

[0003] At present, some disaster recovery solutions rely on the applications used by users to ensure the disaster recovery of data in their respective regions, but this makes the system design of the application very complicated. In order to avoid complex application design, some disaster recovery solutions rely on the underlying data storage components of the database to store and propagate data to other regions, thereby ensuring that users can access data locally and that users can access data in other regions when the local region is unavailable. However, in some application scenarios, this solution cannot meet the needs of the scenario in terms of service performance and data reliability at the same time. Summary of the invention

[0004] In view of this, the embodiments of this specification provide a disaster recovery system. One or more embodiments of this specification also relate to a method for implementing a global service component, an apparatus for implementing a global service component, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of the present specification, a disaster recovery system is provided, including: a global service component and a regional data storage component, wherein: the global service component is configured to receive a data write request, write the data carried by the data write request into an internal storage area of ​​the global service component based on a consistency protocol, and synchronize the data in the internal storage area to the regional data storage component. The data storage component is configured to provide read / write services, and synchronize data in the regional data storage component through the global service component.

[0006] Optionally, the global service component is configured to replicate data in the internal storage area in an asynchronous manner when synchronizing the data in the regional data storage component.

[0007] Optionally, the regional data storage component is configured to first generate a data write request based on the data corresponding to the write service, send the data write request to the global service component based on the consistency protocol, and when the global service component successfully writes the data carried by the data write request into the internal storage area, then copy the data from the global service component in an asynchronous manner, and write the data obtained from the global service component into the storage area of ​​this region.

[0008] Optionally, the regional data storage component is configured to first write the data corresponding to the write service into the storage area of ​​the local area, then generate a data write request according to the data corresponding to the write service, and send the data write request to the global service component.

[0009] Optionally, the regional data storage component is further configured to return corresponding feedback information to the user end when writing data into the storage area of ​​the local region.

[0010] Optionally, the global service component is configured to synchronize the data in the internal storage area to the regional data storage components of the multiple regions as a publisher based on a subscription-publishing mode. Correspondingly, the regional data storage component is configured to obtain data from the global service component as a subscriber based on a subscription-publishing mode.

[0011] Optionally, the data carried by the data write request is log data.

[0012] Optionally, the regional data storage component is configured to generate the log data according to the write service.

[0013] Optionally, the regional data storage component is further configured to maintain a global data table of the regional data storage component based on the log data when a disaster occurs in the data storage in the region.

[0014] Optionally, the regional data storage component is a data storage component of databases of multiple regions in a cross-regional database service.

[0015] According to the second aspect of the embodiments of this specification, a method for implementing a global service component is provided, including: receiving a data write request; writing the data carried by the data write request into an internal storage area of ​​the global service component based on a consistency protocol; and synchronizing the data in the internal storage area to a regional data storage component.

[0016] According to a third aspect of the embodiments of this specification, there is provided an apparatus for implementing a global service component, comprising: a request receiving module configured to receive a data write request; a storage module configured to write the data carried by the data write request to an internal storage area of ​​the global service component based on a consistency protocol; and a replication module configured to synchronize the data in the internal storage area to a regional data storage component.

[0017] According to the fourth aspect of the embodiments of this specification, a computing device is provided, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method for implementing a global service component described in any embodiment of this specification.

[0018] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the method for implementing a global service component described in any embodiment of this specification are implemented.

[0019] The embodiment of one aspect of this specification provides a disaster recovery system. Since the system decouples data replication from regional data storage, an internal global service component based on a consistency protocol is additionally provided, that is, the system includes a global service component and a regional data storage component, wherein the global service component is configured to receive a data write request, write the data carried by the data write request into the internal storage area of ​​the global service component based on a consistency protocol, and synchronize the data in the internal storage area to the regional data storage component; the regional data storage component is configured to provide read / write services, and synchronize data in the regional data storage component through the global service component. Therefore, the global service component performs internal storage based on a consistency protocol, which effectively guarantees data reliability, and the global service component performs data replication for the regional data storage component, without the need for the regional data storage component to participate in data replication as a data provider, which effectively guarantees the performance of the read / write service of the data storage component. It can be seen that the system can meet the dual requirements of the upper layer for data reliability and service performance.

[0020] An embodiment of another aspect of the present specification provides a method for implementing a global service component. Since the global service component implemented by the method receives a data write request, writes the data carried by the data write request into an internal storage area of ​​the global service component based on a consistency protocol, and synchronizes the data in the internal storage area to the regional data storage component, the global service component performs internal storage based on a consistency protocol, thereby effectively ensuring data reliability. In addition, the global service component replicates data for the regional data storage component, and there is no need for the regional data storage component to participate in data replication as a data provider, thereby effectively ensuring the performance of services of the regional data storage component such as read / write services. It can be seen that the system can meet the upper layer's dual requirements for data reliability and service performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a structural diagram of a regional disaster recovery system provided by an embodiment of this specification;

[0022] Figure 2 This is a data access diagram of a distributed application provided by an embodiment of this specification;

[0023] Figure 3 is a structural diagram of a regional disaster recovery system provided by another embodiment of the present specification;

[0024] Figure 4 is a flow chart of a method for implementing a global service component provided by an embodiment of this specification;

[0025] Figure 5 It is a structural diagram of an apparatus for implementing a global service component provided by an embodiment of this specification;

[0026] Figure 6 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0027] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0028] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0029] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0030] First, the terms involved in one or more embodiments of this specification are explained.

[0031] TableStore: A distributed NoSQL data storage service built on Alibaba Cloud's FeiTian distributed system that provides storage and real-time access to massive structured data. TableStore organizes data in the form of instances and tables, and achieves unlimited scalability through data sharding and load balancing technologies. Applications use the TableStore service by calling the TableStore API / SDK or operating the management console.

[0032] Regional disaster recovery: When a region's service is interrupted or performance degrades, the service can be switched to another region to continue to provide read / write services, ensuring service continuity. Regional disaster recovery is essential for national or global services with strict availability requirements.

[0033] RPO: (Recovery Point Object) refers to a point in time in the past to which data can be restored when a disaster or emergency occurs. It is the amount of data loss that the system can tolerate. When RPO = 0, it means that no data will be lost after the service is restored.

[0034] Consistency protocol: a protocol that emerged to solve the consistency problem of multiple copies of data in a distributed system. Common consistency protocols include the two-phase commit protocol (2PC), the three-phase commit protocol (3PC), the Raft algorithm, and the Paxos algorithm. Among the participants who comply with the consistency protocol, each write by a participant needs to be synchronized to other participants before it is considered successful. Therefore, the consistency protocol can ensure that the service is restored without losing data, but it sacrifices the service write performance.

[0035] Global Table: Designed for cross-region distributed applications, it allows a single data table to span multiple regions. It enables fast local reads with low latency in each region and provides disaster recovery capabilities in the event of regional-level outages.

[0036] In this specification, a disaster recovery system is provided. This specification also relates to a method for implementing a global service component and an apparatus, a computing device, and a computer-readable storage medium for implementing the global service component, which are described in detail one by one in the following embodiments.

[0037] See also Figure 1 , Figure 1 FIG. 1 shows a schematic diagram of a disaster recovery system according to an embodiment of the present specification. Figure 1 As shown, the system includes: a global service component 102 and a regional data storage component 104. Among them:

[0038] The global service component 102 may be configured to receive a data write request, write the data carried in the data write request into an internal storage area of ​​the global service component based on a consistency protocol, and synchronize the data in the internal storage area to the regional data storage component.

[0039] The regional data storage component 104 may be configured to provide read / write services and synchronize data in the regional data storage component through the global service component.

[0040] Since the system decouples data replication from regional data storage, an additional global service component based on the consistency protocol is set up internally, that is, the system includes a global service component and a regional data storage component, wherein the global service component is configured to receive a data write request, write the data carried by the data write request into the internal storage area of ​​the global service component based on the consistency protocol, and synchronize the data in the internal storage area to the regional data storage component; the regional data storage component is configured to provide read / write services, and synchronize data in the regional data storage component through the global service component. Therefore, the global service component performs internal storage based on the consistency protocol, which effectively guarantees data reliability, and the global service component performs data replication for the regional data storage component, without the need for the regional data storage component to participate in data replication as a data provider, which effectively guarantees the performance of the services of the data storage component such as the read / write service. It can be seen that the system can meet the upper layer's dual requirements for data reliability and service performance.

[0041] A region can be understood as one of the regions covered by a big data service system that divides regions at any granularity, or it can be understood as one of the components of any service system that divides components at any granularity. For example, in an application scenario where a big data service is implemented based on a distributed system architecture, each region corresponds to a cluster, a cluster corresponds to a distributed system, and all clusters share a global service component.

[0042] For example, Figure 2 The data access diagram of the distributed application shown in the figure, the region can refer to the systems in various regions such as Beijing, Shanghai, and Shenzhen. For example, in distributed applications, it is necessary to achieve low-latency fast local access in each region, and it is necessary to ensure that disaster recovery capabilities are provided when regional service interruptions occur. The above requirements of the application layer require the support of the underlying database, and the underlying database must also be able to meet: span multiple regions and provide regional disaster recovery capabilities. Traditionally, this requires a difficult trade-off between performance, availability, cost, and data integrity. Suppose that the users of an application are distributed throughout the country, and users use applications to update and access their information. According to the regional disaster recovery system provided in the embodiment of this specification, the underlying system can realize automatic replication of data, so that the modification of data in one region is propagated to other regions, so that each region jointly maintains a globally visible global table, which not only ensures that users can access locally, but also ensures that when a region is unavailable, users can still access data in other regions through the global table. The regional disaster recovery system provided in the embodiment of this specification realizes the replication of underlying data, effectively meeting the needs of the global table solution of the database system.

[0043] The regional data storage component can be understood as a component of each region in the big data service that is used to provide data reading and writing functions in the region. For example, in an application scenario where the big data service is implemented based on a distributed system architecture, each region corresponds to a cluster, a cluster corresponds to a distributed system, and a distributed system can include one or more regional data storage components.

[0044] The global service component can be understood as a global component shared by all regions of the big data service and used to synchronize data. The global service component may include one or more internal storage areas, and data is written between these internal storage areas based on a consistency protocol.

[0045] The data write request may be a data write request generated by the regional data storage component to the global service component in response to the writing of data during the process of providing data write service, so as to copy the data to be synchronized to the global service component. Therefore, the data write request carries the data to be synchronized.

[0046] Data synchronization refers to the global service component copying data to each regional data storage component to keep the data of each regional data storage component synchronized.

[0047] In one possible implementation, the global service component is configured to replicate the data in the internal storage area in an asynchronous manner when synchronizing the data to the regional data storage component. The asynchronous manner means that when the global service component synchronizes data to each regional data storage component, the data is not synchronized for a certain period of time. If the data of the global service component is updated, this change will be propagated and applied to other regional data storage components in different transactions. These different transactions can be separated by a period of time, such as a few seconds, minutes, hours, etc. The data between regional data storage components is temporarily asynchronous, but the propagation will eventually ensure that the data between all regional data storage components is the same.

[0048] Taking the application of the disaster recovery system provided in the embodiment of this specification in a distributed database service as an example, the regional data storage component may include data storage components of databases of multiple regions in a cross-regional database service.

[0049] Specifically, for example, in a distributed database service: each cluster corresponds to a distributed database system, and all clusters share a global service component. In a distributed database system, there are generally two roles: one role is responsible for scheduling, which can be called the master (master node), and the other role is responsible for providing data reading and writing requests, which can be called the worker (worker node). Among them, there are generally 1 to N masters, and the number of workers is relatively large. It depends on the scale of the cluster, ranging from dozens to hundreds or even thousands. According to the table storage, a table will be divided into multiple partitions according to the range of data. The master schedules these partitions to each worker according to a certain scheduling strategy and provides services to the outside. The regional data storage component in the worker will generate corresponding log data in response to the writing of data, and generate corresponding data write requests carrying the log data to the global service component. The global service component, whose internal storage is implemented through a consistency protocol, provides an interface for the regional data storage component to write and obtain log data. For example, in the specific implementation, the global service component can be understood as a global queue service.

[0050] Based on the above examples, in one or more embodiments of the present specification, the data carried by the data write request may be log data. In an application scenario where the regional data storage component is used to provide a data write service, the regional data storage component may also be configured to generate the log data according to the write service. For example, in conjunction with the above examples, a worker may call the write service provided by the regional data storage component to write database data, and accordingly, the regional data storage component generates corresponding log data in response to the write service being called by the worker.

[0051] In addition, in the database scenario of distributed applications, in order to ensure that when one area is unavailable, users can still access data in other areas through global tables, in one or more embodiments of the present specification, the regional data storage component is also configured to maintain the data global table of the regional data storage component based on the log data when a disaster occurs in the data storage in the local area.

[0052] In order to make the regional disaster recovery system provided by the embodiments of this specification easier to understand, two possible writing processes of the data storage component are schematically described below.

[0053] For example, in one or more embodiments, the regional data storage component is configured to first generate a data write request based on the data corresponding to the write service, send the data write request to the global service component based on the consistency protocol, and when the global service component successfully writes the data carried by the data write request into the internal storage area, then copy the data from the global service component in an asynchronous manner, and write the data obtained from the global service component into the storage area of ​​this region.

[0054] In this embodiment, based on the consistency protocol, at least one regional data storage component will only perform local storage in the region after successfully copying the data to the global service component, and the global service component will not lose data. Moreover, based on the asynchronous replication of the global service component, it can be guaranteed that after the service of the region is interrupted, the RPO=0 after the service is switched to other regions, and there will be no data loss, which can enable multiple regions to provide read / write services. Moreover, since the data is considered successful when it is copied to the global service component, the regional data storage component does not participate in the data propagation process of the global service component to other regional data storage components. Therefore, the next write of the regional data storage component does not need to wait for the global replication of other regional data storage components to be completed, which effectively guarantees the write performance of the regional data storage component. For upper-layer applications that are more sensitive to performance, the service performance is better.

[0055] For another example, in one or more embodiments, the regional data storage component is configured to first write the data corresponding to the write service into the storage area of ​​the local area, then generate a data write request based on the data corresponding to the write service, and send the data write request to the global service component.

[0056] In this embodiment, since the regional data storage component first writes the data to the storage area of ​​the local area, data access can be completed locally, and the data is globally visible after the global service component copies the data to other regional data storage components, and the data access performance is better. Therefore, upper-level applications that are sensitive to performance can use this embodiment to provide access performance.

[0057] It should be noted that the regional data storage components corresponding to the above two embodiments can be implemented simultaneously or selectively in the disaster recovery system provided in the embodiments of this specification. For example, the disaster recovery system provided in the embodiments of this specification can combine these two implementation methods, and the global service component uses its own consistency protocol to deploy across regions and asynchronous replication to perform regional disaster recovery, thereby meeting the various performance requirements of regional disaster recovery. That is, according to different upper-level requirements, according to the disaster recovery system provided in the embodiments of this specification, the global service component can provide strong consistent synchronous replication internally to achieve "a high-performance regional disaster recovery solution with a slight sacrifice of data reliability", and can also provide high-performance asynchronous replication externally to achieve "a high-reliability regional disaster recovery solution with a slight sacrifice of write performance", making the expansion of each component more flexible, and an architecture can simultaneously meet the services of different types of regional data storage components, realizing a regional disaster recovery solution that is compatible with high performance and high reliability.

[0058] The disaster recovery system provided in the embodiments of this specification can be applied to the database bottom layer of big data services, and can also be applied to any other possible scenarios to solve similar problems. For example, the global service component can be expressed as a cross-regional queue in a specific application scenario, and the data of clusters in different regions can be synchronized through the cross-regional queue.

[0059] In addition, in order to enable the upper-level user to perceive the result of the regional data storage component's write service, in one or more embodiments of the present specification, the regional data storage component is also configured to return corresponding feedback information to the user end when writing data to the storage area of ​​the local area.

[0060] For example, information on writing success or failure may be fed back. The user end may be understood as a user end that writes data to the regional data storage component.

[0061] For example, in an embodiment in which one or more regional data storage components replicate data to a global service component based on a consistency protocol, a user client accesses a corresponding region of the cluster, and the regional data storage component writes the corresponding data to the global service component. The regional data storage component obtains the data from the global service component, persists the obtained data in the local cluster of the region, and returns feedback information corresponding to the write behavior to the user client.

[0062] For another example, in an embodiment in which the data storage component copies data to the global service component in an asynchronous manner, the user client accesses the corresponding area of ​​the cluster, the regional data storage component persists the corresponding data in the local cluster, returns feedback information corresponding to the write behavior to the user client, and then asynchronously writes the data to the global service component, which then asynchronously copies the data to other clusters.

[0063] It should be noted that, in the disaster recovery system provided by the embodiments of this specification, when the global service component copies data to each regional data storage component, asynchronous replication can be implemented in any manner. For example, in one or more embodiments of this specification, asynchronous replication is performed based on a subscription-publishing model. Specifically, in this embodiment, the global service component is configured to synchronize the data in the internal storage area to the regional data storage components in the multiple regions as a publisher based on a subscription-publishing model. Correspondingly, the regional data storage component is configured to obtain data from the global service component as a subscriber based on a subscription-publishing model.

[0064] In the above embodiment, the global service component replicates data based on the subscription and publication mode, and the global service component and the regional data storage component are not only loosely coupled but also highly extensible. The global service component and the regional data storage component can each continue to operate normally without having to care about each other. Based on the subscription and publication mode, the global service component and the regional data storage component are not only decoupled in structure, but also decoupled in time, so as to achieve the purpose of efficient data asynchronous replication.

[0065] See also Figure 3 , Figure 3 FIG. 2 shows a schematic diagram of a disaster recovery system according to another embodiment of the present specification. Figure 3 As shown, the system includes: a global service component and regional data storage components of multiple regions. For example: multiple regions may include: region 1, region 2, and region 3. Region 1 includes cluster 1, region 2 includes cluster 2, and region 3 includes cluster 3. Among them, the regional data storage component of each cluster faces the upper layer, can receive read / write requests incoming from the upper layer, and provide read / write services for database data to the upper layer. The regional data storage component sends a write request for log data to the global service, and based on the subscription and publishing mode, as a subscriber, asynchronously obtains log data that needs to be globally synchronized from the global service component. The global service component may include multiple internal storage areas, and the multiple internal storage areas as a whole can be understood as a consistency protocol group.

[0066] For example, any one or more regional data storage components perform strong consistency replication based on the consistency protocol, and the data writing process includes: the user client accesses the corresponding area of ​​the cluster, and the regional data storage component writes the log data to the global service component based on the consistency protocol in response to the access. The regional data storage component subscribes to the log data from the global service component, persists the subscribed log data in the local cluster, and returns the feedback information corresponding to the write behavior to the user client.

[0067] For another example, any one or more data storage components replicate data based on asynchronous replication, and the data writing process includes: the user client accesses the corresponding area of ​​the cluster, the regional data storage component persists the log data to the local cluster in response to the access, and returns the feedback information corresponding to the write behavior to the user client, and the regional data storage component asynchronously writes the log data to the global service component and subscribes to the log data written by other clusters.

[0068] pass Figure 3 As can be seen from the illustrated embodiment, through the support of global service components and regional data storage components at the bottom layer of the database, the bottom layer of the database can span multiple regions and provide regional-level disaster recovery capabilities, and achieve the balance required by the application scenario between performance, availability, cost and data integrity.

[0069] Corresponding to the above system embodiment, this specification also provides a method embodiment for implementing a global service component. Figure 4 FIG. 1 is a flowchart of a method for implementing a global service component provided by an embodiment of the present specification. Figure 4 As shown, the method includes:

[0070] Step 402: Receive a data write request.

[0071] For example, in a database application scenario, the data carried by the data write request may be log data.

[0072] Step 404: Write the data carried in the data write request into the internal storage area of ​​the global service component based on the consistency protocol.

[0073] Step 406: Synchronize the data in the internal storage area to the regional data storage component.

[0074] For example, synchronizing the data in the internal storage area to the regional data storage component may include: synchronizing the data in the internal storage area to the data storage components in the multiple regions as a publisher based on a subscription publishing mode. Accordingly, the regional data component may be enabled to obtain data from the global service component as a subscriber based on a subscription publishing mode.

[0075] For example, the log data may also enable the regional data storage component to maintain the data global table of the regional data storage component based on the log data when a disaster occurs in the data storage in the region.

[0076] Since the global service component implemented by this method receives a data write request, writes the data carried in the data write request into the internal storage area of ​​the global service component based on a consistency protocol, and synchronizes the data in the internal storage area to the regional data storage component, the global service component performs internal storage based on a consistency protocol, which effectively ensures data reliability. In addition, the global service component performs data synchronization replication for the regional data storage component, and there is no need for the regional data storage component to participate in data replication as a data provider, which effectively ensures the performance of the write service of the regional data storage component. It can be seen that this method can meet the upper layer's dual requirements for data reliability and write service performance.

[0077] Corresponding to the above method embodiment, this specification also provides a device embodiment for implementing a global service component. Figure 5 FIG. 1 shows a schematic diagram of a structure of a device for implementing a global service component provided by an embodiment of the present specification. Figure 5 As shown, the device comprises:

[0078] The request receiving module 502 may be configured to receive a data writing request.

[0079] The storage module 504 may be configured to write the data carried in the data write request into the internal storage area of ​​the global service component based on a consistency protocol.

[0080] The replication module 506 may be configured to synchronize the data in the internal storage area to the regional data storage component.

[0081] Since the global service component implemented by this method receives a data write request, writes the data carried in the data write request into the internal storage area of ​​the global service component based on a consistency protocol, and synchronizes the data in the internal storage area to the regional data storage component, the global service component performs internal storage based on a consistency protocol, which effectively ensures data reliability. In addition, the global service component performs data synchronization replication for the regional data storage component, and there is no need for the regional data storage component to participate in data replication as a data provider, which effectively ensures the performance of the write service of the regional data storage component. It can be seen that this method can meet the upper layer's dual requirements for data reliability and write service performance.

[0082] The above is a schematic scheme of a device for implementing a global service component in this embodiment. It should be noted that the technical scheme of the device for implementing a global service component and the technical scheme of the method for implementing a global service component described above belong to the same concept, and the details of the technical scheme of the device for implementing a global service component that are not described in detail can all be referred to the description of the technical scheme of the method for implementing a global service component described above.

[0083] Figure 6The block diagram of a computing device 600 according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.

[0084] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0085] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0086] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.

[0087] The processor 620 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the method for implementing the global service component. For example, including:

[0088] Receive data writing request;

[0089] Writing the data carried in the data write request into the internal storage area of ​​the global service component based on the consistency protocol;

[0090] The data in the internal storage area is synchronized to the regional data storage component.

[0091] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the method for implementing the global service component described above belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the method for implementing the global service component described above.

[0092] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for implementing the global service component. For example, including:

[0093] Receive data writing request;

[0094] Writing the data carried in the data write request into the internal storage area of ​​the global service component based on the consistency protocol;

[0095] The data in the internal storage area is synchronized to the regional data storage component.

[0096] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the method for implementing the global service component described above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the method for implementing the global service component described above.

[0097] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned method for implementing a global service component. For example, it includes:

[0098] Receive data writing request;

[0099] Writing the data carried in the data write request into the internal storage area of ​​the global service component based on the consistency protocol;

[0100] The data in the internal storage area is synchronized to the regional data storage component.

[0101] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the method for implementing the global service component described above are of the same concept, and the details not described in detail in the technical scheme of the computer program can be found in the description of the technical scheme of the method for implementing the global service component described above.

[0102] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0103] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0104] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0105] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A disaster recovery system, comprising: A global service component and at least two regional data storage components, where: The global service component is configured to receive a data write request, write the data carried by the data write request into the internal storage area of ​​the global service component based on a consistency protocol, and synchronize the data in the internal storage area to the regional data storage component, wherein the data write request comes from one of the regional data storage components, and one of the regional data storage components writes the data to the local storage when the global service component writes the data into the internal storage area of ​​the global service component, and the global service component is a cross-regional queue; The regional data storage component is configured to provide read / write services and synchronize data in the regional data storage component through the global service component; The global service component is configured to synchronize the data in the internal storage area to the regional data storage components in multiple regions as a publisher based on a subscription publishing mode; The regional data storage component is configured to obtain data from the global service component as a subscriber based on a subscription publishing mode.

2. The system according to claim 1, wherein the global service component is configured to replicate in an asynchronous manner when synchronizing the data in the internal storage area to the regional data storage component.

3. According to the system described in claim 2, the regional data storage component is configured to first generate a data write request according to the data corresponding to the write service, send the data write request to the global service component based on the consistency protocol, and when the global service component successfully writes the data carried by the data write request into the internal storage area, then copy the data from the global service component in an asynchronous manner, and write the data obtained from the global service component into the storage area of ​​this region.

4. According to the system described in claim 2, the regional data storage component is configured to first write the data corresponding to the write service into the storage area of ​​this region, then generate a data write request based on the data corresponding to the write service, and send the data write request to the global service component.

5. The system according to claim 3 or 4, wherein the regional data storage component is further configured to return corresponding feedback information to the user end when writing data into the storage area of ​​the local area. The system according to claim 1 , wherein the data carried by the data write request is log data. 7 . The system according to claim 6 , wherein the regional data storage component is configured to generate the log data according to the write service.

8. According to the system of claim 7, the regional data storage component is further configured to maintain the data global table of the regional data storage component based on the log data when a disaster occurs in the data storage in this area.

9. According to the system of claim 1, the regional data storage component is a data storage component of databases in multiple regions in a cross-regional database service.

10. A method for implementing a global service component, comprising: Receive data writing request; Write the data carried by the data write request into the internal storage area of ​​the global service component based on the consistency protocol, wherein the data write request comes from one of the regional data storage components, and when the global service component writes the data into the internal storage area of ​​the global service component, the one of the regional data storage components writes the data into the local storage, the global service component is a cross-region queue, the regional data storage components include at least two, and the global service component, as a publisher based on the subscription publishing mode, synchronizes the data in the internal storage area to the regional data storage components in multiple regions; The data in the internal storage area is synchronized to a regional data storage component, wherein the regional data storage component obtains data from the global service component as a subscriber based on a subscription-publishing mode.

11. A device for implementing a global service component, comprising: A request receiving module, configured to receive a data writing request; A storage module is configured to write the data carried by the data write request into the internal storage area of ​​the global service component based on a consistency protocol, wherein the data write request comes from one of the regional data storage components, and when the global service component writes the data into the internal storage area of ​​the global service component, the one of the regional data storage components writes the data into the local storage, the global service component is a cross-regional queue, and the regional data storage components include at least two, the global service component is a cross-regional queue, and the regional data storage components include at least two, and the global service component, as a publisher based on a subscription-publishing mode, synchronizes the data in the internal storage area to the regional data storage components in multiple regions; The replication module is configured to synchronize the data in the internal storage area to the regional data storage component, wherein the regional data storage component obtains data from the global service component as a subscriber based on a subscription publishing mode.

12. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for implementing a global service component as claimed in claim 10 are implemented.

13. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for implementing a global service component as claimed in claim 10.

14. A computer program product, characterized in that The method comprises computer instructions, which implement the steps of the method for implementing a global service component as claimed in claim 10 when the computer instructions are executed by a processor.

Citation Information

Patent Citations

  • Method and equipment for ensuring data correctness

    CN107766354A

  • Distributed data storage method and system, computer equipment and storage medium

    CN111343277A