A cloud-native high-availability database service providing system and method

By employing a master-slave dual-standby service container and proxy container model in cloud-native databases, combined with container orchestrator storage components, the problem of inconsistent high-availability deployments for different database types is solved, achieving efficient and reliable database system deployment and operation.

CN115510156BActive Publication Date: 2026-04-07NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-22
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing cloud-native software architectures, the high-availability deployment methods of different subsystems using different databases are inconsistent, resulting in high development and maintenance costs, difficulty in locating problems, and the inability to monitor in a unified manner.

Method used

This paper provides a cloud-native high-availability database service system. It adopts a master-slave mode, implements database functions through service containers and proxy containers, and manages container status by combining container orchestrator storage components to achieve high-availability deployment and unified monitoring of the database.

Benefits of technology

It simplifies the deployment process for different database types, improves deployment efficiency and ease of operation and maintenance, reduces development and maintenance costs, and enables unified monitoring and fault switching of database systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510156B_ABST
    Figure CN115510156B_ABST
Patent Text Reader

Abstract

This application relates to the field of data storage technology, and in particular to a cloud-native high-availability database service provision system and method. The method is applied to various sub-databases included in a cloud-native database, wherein the cloud-native database includes multiple sub-databases of different database types, each sub-database includes multiple storage nodes, and the multiple storage nodes adopt a primary-secondary model. The system includes: service containers created for each of the multiple storage nodes included in the target sub-database, wherein each service container corresponding to a storage node includes an instance process for providing database functions and a coordination process for primary-secondary storage node election; and at least one proxy container, wherein the proxy container includes a proxy process for proxying and forwarding data processing requests sent by clients, the proxy process establishing a connection with the client and proxying and forwarding the processing requests sent by the client to the storage nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a cloud-native high-availability database service provision system and method. Background Technology

[0002] In recent years, digital experiences have played a vital role in people's daily lives, and people's expectations for software have been rising. They expect applications to always be available, continuously upgradeable, and provide personalized experiences. The cloud-native software architecture style has emerged in response to this demand, with its core characteristics being: highly distributed, the ability to operate in constantly changing environments, and the continuous evolution and change of the software itself.

[0003] Cloud-native software is designed to anticipate failures and remain stable even when the infrastructure it depends on fails or other changes occur.

[0004] With the widespread application of SDN technology across various fields, the entire SDN solution encompasses numerous subdomains. Each subsystem integrates different databases according to its specific needs, and some systems even have their own lightweight data services. Compared to stateless services, stateful data services face more complex and challenging technical challenges in achieving redundancy, adaptability, and dynamic scaling. Furthermore, the solutions for containerized deployment of different database middleware are not standardized, and monitoring dimensions vary widely, requiring significant maintenance costs. If the database service is self-developed, a custom containerized deployment solution must be developed.

[0005] Currently, SDN solutions encompass numerous subdomains, each employing different databases. Furthermore, the high-availability deployment methods for these databases vary, with some requiring customized development and deployment solutions. This results in high development and maintenance costs, a lack of unified monitoring, and significant difficulties in troubleshooting. Examples include the Stolon solution for PostgreSQL, the PXC solution for Percona Server, and the Sentinel solution for Redis. Summary of the Invention

[0006] This application provides a cloud-native high-availability database provisioning system and method.

[0007] Firstly, this application provides a cloud-native high-availability database service provision system, applied to various sub-databases included in a cloud-native database. The cloud-native database includes multiple sub-databases of different database types, each sub-database includes multiple storage nodes, and the multiple storage nodes adopt a primary-multiple-standby mode. The system includes:

[0008] Service containers are created for the multiple storage nodes included in the target sub-database. Each service container for a storage node includes an instance process for providing database functions and a coordination process for electing primary and backup storage nodes.

[0009] At least one proxy container, wherein a proxy container includes a proxy process for proxying and forwarding data processing requests sent by a client, the proxy process establishing a connection with the client and proxying and forwarding the processing requests sent by the client to the storage node.

[0010] Optionally, the system further includes a container orchestrator storage component, which stores container status information of each container included in the system. The container status information of each container includes the primary / backup status of each service container. The proxy container forwards the processing requests sent by the client to the primary storage node corresponding to the primary service container.

[0011] Optionally, the proxy container determines the current primary service container and backup service container based on the primary and backup status of each service container contained in the container status information of each container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the processing request sent by the client to the primary storage node corresponding to the primary service container.

[0012] When the first service container, which is the primary service container, fails, and the second service container, which is the backup service container, switches to become the primary service container, the primary / backup status of the first service container stored in the container orchestrator storage component is changed to backup, and the primary / backup status of the second service container is changed to primary. After the proxy container obtains the primary / backup status of the second service container stored in the container orchestrator storage component, it forwards the processing request sent by the client to the storage node corresponding to the second service container.

[0013] Optionally, the processing requests sent by the client include read requests and write requests; the proxy container establishes a connection with the main service container and forwards the write requests sent by the client to the main storage node corresponding to the main service container; the proxy container establishes a connection with the backup service container and forwards the read requests sent by the client to the backup storage node corresponding to the backup service container.

[0014] Optionally, the cloud-native database also includes a backup target sub-database corresponding to the target sub-database, service containers created for the multiple storage nodes included in the backup target sub-database, at least one proxy container, and a container orchestrator storage component;

[0015] A connection is established between the primary service container of the target sub-database and the primary service container of the backup target sub-database, and a streaming replication mechanism is established. When the backup target subsystem switches to primary, the primary service container of the backup target sub-database provides data storage services to the outside world.

[0016] Secondly, this application provides a method for providing cloud-native high-availability database services, applied to various sub-databases included in a cloud-native database. The cloud-native database includes multiple sub-databases of different database types, each sub-database includes multiple storage nodes, and the multiple storage nodes adopt a primary-multiple-standby mode. The method includes:

[0017] For each of the multiple storage nodes included in the target sub-database, a corresponding service container is created. Each service container for a storage node includes an instance process for providing database functions and a coordination process for electing primary and standby storage nodes.

[0018] At least one proxy container is created for the target sub-database. Each proxy container includes a proxy process for forwarding data processing requests sent by a client. The proxy process establishes a connection with the client and forwards the processing requests sent by the client to the storage node.

[0019] Optionally, the method further includes:

[0020] A container orchestrator storage component is created for the target sub-database to store the container status information of each container included in the target sub-database. The container status information of each container includes the primary and backup status of each service container.

[0021] The proxy container forwards the processing requests sent by the client to the main storage node corresponding to the main service container.

[0022] Optionally, the proxy container determines the current primary service container and backup service container based on the primary and backup status of each service container contained in the container status information of each container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the processing request sent by the client to the primary storage node corresponding to the primary service container.

[0023] When the first service container, which is the primary service container, fails, and the second service container, which is the backup service container, switches to become the primary service container, the primary / backup status of the first service container stored in the container orchestrator storage component is changed to backup, and the primary / backup status of the second service container is changed to primary. After the proxy container obtains the primary / backup status of the second service container stored in the container orchestrator storage component, it forwards the processing request sent by the client to the storage node corresponding to the second service container.

[0024] Optionally, the processing requests sent by the client include read requests and write requests;

[0025] The proxy container establishes a connection with the main service container and forwards the write requests sent by the client to the main storage node corresponding to the main service container; the proxy container establishes a connection with the backup service container and forwards the read requests sent by the client to the backup storage node corresponding to the backup service container.

[0026] Optionally, the cloud-native database also includes a backup target sub-database corresponding to the target sub-database, service containers created for the multiple storage nodes included in the backup target sub-database, at least one proxy container, and a container orchestrator storage component;

[0027] A connection is established between the primary service container of the target sub-database and the primary service container of the backup target sub-database, and a streaming replication mechanism is established. When the backup target subsystem switches to primary, the primary service container of the backup target sub-database provides data storage services to the outside world.

[0028] In summary, the cloud-native high-availability database service provision system provided in this application embodiment is applied to various sub-databases included in the cloud-native database. The cloud-native database includes multiple sub-databases of different database types, and each sub-database includes multiple storage nodes. The multiple storage nodes adopt a one-primary-multiple-backup mode. The system includes: service containers created for the multiple storage nodes included in the target sub-database respectively, wherein the service container corresponding to each storage node includes an instance process for providing database functions and a coordination process for primary and backup storage node election; at least one proxy container, wherein the proxy container includes a proxy process for proxying and forwarding data processing requests sent by the client. The proxy process establishes a connection with the client and proxies and forwards the processing requests sent by the client to the storage nodes.

[0029] The cloud-native high-availability database service provision system provided in this application defines a common high-availability database deployment method for each database. The sub-databases of different database types included in the cloud-native database are deployed using a common high-availability deployment method. Compared with databases of different database types using different high-availability deployment methods, this simplifies the deployment process, improves deployment efficiency, and makes the subsequent operation and maintenance of the database simpler and more reliable. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this application.

[0031] Figure 1 A schematic diagram of the structure of a cloud-native high-availability database service provision system provided in this application embodiment;

[0032] Figure 2 This is a schematic diagram illustrating a database instance copying process provided in an embodiment of this application;

[0033] Figure 3 A detailed flowchart of a method for providing cloud-native high-availability database services is provided in an embodiment of this application. Detailed Implementation

[0034] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.

[0035] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."

[0036] With the widespread application of cloud-native technologies in various fields, a network system can contain numerous sub-domain systems, each integrating different types of databases according to the needs of the scenario. Consequently, the deployment methods for high-availability databases in each sub-system may differ, leading to complex deployment processes and high maintenance costs. This application proposes a cloud-native high-availability database service provision system and method to address these issues.

[0037] For example, see Figure 1The diagram shown is a structural schematic of a cloud-native high-availability database service provision system provided in this application embodiment. It is applied to various sub-databases included in a cloud-native database. The cloud-native database includes multiple sub-databases of different database types, and each sub-database includes multiple storage nodes. The multiple storage nodes adopt a primary-multiple-standby mode. Taking a sub-database as the target sub-database as an example, the system includes:

[0038] Service containers are created for the multiple storage nodes included in the target sub-database. Each service container for a storage node includes an instance process for providing database functionality and a coordination process for electing primary and backup storage nodes.

[0039] In this embodiment, assuming the target sub-database includes 3 storage nodes (backend storage, not shown in the figure), then 3 service containers corresponding one-to-one with the storage nodes can be created based on a container orchestrator (e.g., Kubernetes). It should be noted that a service container includes at least one instance process and one coordinating process. The instance process is used to provide database functionality and has the ability to perform streaming replication, which can be asynchronous or synchronous streaming replication. The coordinating processes included in each service container are configured with an election protocol for the election of the master service container (i.e., the master storage node), which can solve the consistency problem of the master storage node under abnormal scenarios such as network instability and system crash restart.

[0040] The system also includes at least one proxy container, wherein a proxy container includes a proxy process for proxying and forwarding data processing requests sent by the client. The proxy process is mainly responsible for client connection processing. The proxy process establishes a connection with the client and forwards the processing requests sent by the client to the storage node.

[0041] Furthermore, in this embodiment of the application, the system further includes a container orchestrator storage component, which is used to store the container status information of each container included in the system, including the primary / backup status of each service container.

[0042] In other words, when building a highly available database service for the target subsystem and creating each container, a container orchestrator storage component can also be created on the storage server to maintain the container status information of each container. For example, the coordination process of each service container can report the status information of its own service container (including health indicator information, whether the service container is the primary service container, etc.) to the container orchestrator storage component. In this way, the container orchestrator storage component maintains the primary and backup status information of each service container.

[0043] It should be noted that the coordination process can also maintain the cluster data of the target subsystem to the container orchestrator storage component. For example, the coordination process can also report the master-slave switchover data to the container orchestrator storage component, which can also store the cluster metadata of the target subsystem (such as cluster status information).

[0044] In this embodiment of the application, since the container status information of each container stored in the container orchestrator storage component includes the primary and backup status of each service container, the proxy container can determine the current primary service container and backup service container based on the primary and backup status of each service container included in the container status information of each container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the processing request sent by the client to the primary storage node corresponding to the primary service container.

[0045] In practical applications, the proxy container connects directly to the client, and at least one proxy container uses a load-sharing approach to forward data access requests sent by the client. The number of proxy containers can be created as needed, and multiple proxy containers can be started, running on different physical servers. This satisfies the client's need to access the storage network from the nearest location.

[0046] A preferred implementation is that the proxy container obtains the main service container information from the container orchestrator storage component, and then forwards the proxy to the main service container, that is, routes the data access requests sent by the client to the storage node corresponding to the main service container.

[0047] Furthermore, the processing requests sent by the client include read requests and write requests. Therefore, the proxy container establishes a connection with the main service container and forwards the write requests sent by the client to the primary storage node corresponding to the main service container; the proxy container can also establish a connection with the backup service container and forward the read requests sent by the client to the backup storage node corresponding to the backup service container.

[0048] When the first service container, which is the primary service container, fails, and the second service container, which is the backup service container, switches to become the primary service container, the primary / backup status of the first service container stored in the container orchestrator storage component is changed to backup, and the primary / backup status of the second service container is changed to primary. After the proxy container obtains the primary / backup status of the second service container stored in the container orchestrator storage component, it forwards the processing request sent by the client to the storage node corresponding to the second service container.

[0049] The cluster anomaly issues that need to be addressed include:

[0050] 1. The server node hosting the master / slave service containers crashed;

[0051] 2. Network jitter, network partitioning, etc.;

[0052] 3. In the case of split-brain scenario, how to handle inconsistent data after the cluster state is restored.

[0053] In this embodiment of the application, the Raft algorithm protocol is configured among the coordination processes to elect the master service container (master storage node). Specifically, if the server node where the service container resides goes down, a new master election process is not triggered. If the server node where the master service container resides goes down, according to the Raft algorithm execution flow, the coordination process discovers that the master service container does not exist and begins to elect a new master, changing to the candidate state. When a service container receives the consent of a majority of voters, it changes to the leader state, and a new master service container is elected. Then, the configuration of the instance processes is changed, and the instance processes included in the master service container become the master instance processes.

[0054] When a network partition occurs, leading to a split-brain scenario, the new master container, having a longer tenure, updates the data in the container orchestrator's storage. The proxy containers then route client connections to the new master service container based on this data, disconnecting client connections from the old master service container.

[0055] Furthermore, in this embodiment of the application, the cloud-native database also includes a backup target sub-database corresponding to the target sub-database, service containers created for the multiple storage nodes included in the backup target sub-database, at least one proxy container and a container orchestrator storage component; a connection is established between the main service container of the target sub-database and the main service container of the backup target sub-database, and a streaming replication mechanism is established. When the backup target subsystem switches to the primary, the main service container of the backup target sub-database provides data storage services to the outside world.

[0056] For example, see Figure 2 The diagram illustrates the database instance replication process provided in this embodiment. The standby cluster selects a master instance process, queries the IP address of the master instance process on the master site via the K8S API, and establishes a streaming replication relationship. If an anomaly occurs within the standby cluster, such as a crash or network instability, the master-standby instance process switching process is executed, which will not be elaborated here. When a master-standby site switch occurs, the hook function for master-standby switch is listened to, the standby site is promoted to master site, and the master instance process on the standby site provides storage services to the outside world. If the master-standby site switch is manual, the master site is demoted to standby and the demotion action is executed. If a disaster causes the master site to crash, the standby site is switched to the new master site, and after the original master site recovers, the service is restarted as the standby site.

[0057] In practical applications, database services on primary and backup sites often adopt a "primary cluster - backup cluster" hot standby approach, which has the following advantages compared to using the same cluster for primary and backup sites:

[0058] 1. Nodes in the standby cluster do not participate in actions such as leader election in the primary cluster;

[0059] 2. There is no master election action within the standby cluster; it only needs to maintain streaming replication with the master database.

[0060] 3. In the event of a disaster, it is easier to directly elect a master from the backup cluster when the backup cluster is promoted to the master cluster;

[0061] 4. The standby cluster only needs to select a single instance process to maintain a streaming replication relationship with the primary database, while other instance processes maintain a streaming replication relationship with that instance. This saves traffic on the data synchronization link and reduces the risk of data inconsistency.

[0062] Furthermore, the cloud-native high-availability database service provider system provided in this application embodiment may also include a monitoring container, that is, a monitoring container is created including a monitoring process. The monitoring process can obtain the cluster status of the target subsystem from the storage components of the container orchestration based on a preset period, and can query and display the container status (cluster status) of each container included in the target subsystem in real time.

[0063] For example, see Figure 3 The diagram shown is a detailed flowchart of a method for providing a cloud-native high-availability database service according to an embodiment of this application. This method is applied to various sub-databases included in a cloud-native database. The cloud-native database includes multiple sub-databases of different database types, and each sub-database includes multiple storage nodes. The multiple storage nodes adopt a primary-multiple-standby mode. The method includes the following steps:

[0064] Step 300: Create corresponding service containers for each of the multiple storage nodes included in the target sub-database. Each service container for a storage node includes an instance process for providing database functions and a coordination process for electing primary and backup storage nodes.

[0065] Step 310: Create at least one proxy container for the target sub-database, wherein a proxy container includes a proxy process for proxying and forwarding data processing requests sent by the client. The proxy process establishes a connection with the client and forwards the processing requests sent by the client to the storage node.

[0066] In this embodiment of the application, a container orchestrator storage component is created for storing the container status information of each container included in the target sub-database. The container status information of each container includes the primary and backup status of each service container. The proxy container forwards the processing requests sent by the client to the primary storage node corresponding to the primary service container.

[0067] Based on the above description, the proxy container determines the current primary service container and backup service container based on the primary and backup status of each service container, which is included in the container status information of each container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the processing request sent by the client to the primary storage node corresponding to the primary service container.

[0068] When an anomaly is detected in the first service container, which is the primary service container, and the second service container, which is the backup service container, is switched to become the primary service container, the primary / backup status of the first service container stored in the container orchestrator storage component is changed to backup, and the primary / backup status of the second service container is changed to primary. After the proxy container obtains the primary / backup status of the second service container stored in the container orchestrator storage component, it forwards the processing request sent by the client to the storage node corresponding to the second service container.

[0069] Furthermore, the processing requests sent by the client include read requests and write requests; then, the proxy container establishes a connection with the main service container and forwards the write requests sent by the client to the main storage node corresponding to the main service container; the proxy container establishes a connection with the backup service container and forwards the read requests sent by the client to the backup storage node corresponding to the backup service container.

[0070] This allows for the distribution of read and write traffic, reducing the performance processing pressure on individual storage nodes, improving the efficiency of client access request processing, and enhancing the user experience.

[0071] Furthermore, the cloud-native database also includes a backup target sub-database corresponding to the target sub-database, service containers created for the multiple storage nodes included in the backup target sub-database, at least one proxy container, and a container orchestrator storage component.

[0072] A connection is established between the primary service container of the target sub-database and the primary service container of the backup target sub-database, and a streaming replication mechanism is established. When the backup target subsystem switches to primary, the primary service container of the backup target sub-database provides data storage services to the outside world.

[0073] These units can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when one of these units is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these units can be integrated together to form a system-on-a-chip (SOC).

[0074] Optionally, this application also provides a program product, such as a computer-readable storage medium storing computer-executable instructions for causing the computer to perform the above-described method embodiments.

[0075] Here, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, a machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0076] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.

[0077] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0078] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0079] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0080] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0081] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0082] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A cloud-native high-availability database service provision system, characterized in that, The system is applied to various sub-databases included in a cloud-native database. The cloud-native database includes multiple sub-databases of different database types, and each sub-database includes multiple storage nodes. These storage nodes employ a primary-multiple-standby mode. The system includes: Service containers are created for the multiple storage nodes included in the target sub-database. Each service container for each storage node includes an instance process for providing database functions and a coordination process for electing the primary and backup storage nodes. The coordination processes are configured with the Raft election protocol to autonomously complete the primary and backup switchover when the network partition or the primary node fails. At least one proxy container, wherein a proxy container includes a proxy process for proxying and forwarding data processing requests sent by a client, the proxy process establishing a connection with the client and proxying and forwarding the processing requests sent by the client to the storage node; The system also includes a container orchestrator storage component, which is used to store the container status information of each container included in the system. The container status information of each container includes the primary / standby status and health indicators of each service container. The client sends processing requests including read requests and write requests. The proxy container determines the current primary service container based on the primary and backup status of each service container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the write requests sent by the client to the primary storage node corresponding to the primary service container. The proxy container also establishes a connection with the backup service container and forwards the read requests sent by the client to the backup storage node corresponding to the backup service container. The cloud-native database also includes a backup target sub-database corresponding to the target sub-database, service containers created for the multiple storage nodes included in the backup target sub-database, at least one proxy container and container orchestrator storage component; An asynchronous streaming replication connection channel is established between the primary service container of the target sub-database and the primary service container of the backup target sub-database. When a failure is detected in the cluster where the target sub-database is located, and the backup target subsystem switches to become the primary system, the primary service container of the backup target sub-database provides data storage services to the outside world.

2. The system as described in claim 1, characterized in that, The proxy container determines the current primary service container and backup service container based on the primary and backup status of each service container, which is included in the container status information of each container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the processing request sent by the client to the primary storage node corresponding to the primary service container. When the first service container, which is the primary service container, fails, and the second service container, which is the backup service container, switches to become the primary service container, the primary / backup status of the first service container stored in the container orchestrator storage component is changed to backup, and the primary / backup status of the second service container is changed to primary. After the proxy container obtains the primary / backup status of the second service container stored in the container orchestrator storage component, it forwards the processing request sent by the client to the storage node corresponding to the second service container.

3. A method for providing cloud-native highly available database services, characterized in that, The method is applied to various sub-databases included in a cloud-native database, wherein the cloud-native database includes multiple sub-databases of different database types, each sub-database includes multiple storage nodes, and the multiple storage nodes adopt a one-primary-multiple-standby mode. The method includes: For each of the multiple storage nodes included in the target sub-database, a corresponding service container is created. Each service container for a storage node includes an instance process for providing database functions and a coordination process for electing primary and standby storage nodes. At least one proxy container is created for the target sub-database, wherein a proxy container includes a proxy process for proxying and forwarding data processing requests sent by a client. The proxy process establishes a connection with the client and proxies and forwards the processing requests sent by the client to the storage node. The method further includes: A container orchestrator storage component is created for the target sub-database to store the container status information of each container included in the target sub-database. The container status information of each container includes the primary / standby status and health indication of each service container. The proxy container forwards the processing requests sent by the client to the main storage node corresponding to the main service container; The client sends processing requests including read requests and write requests. The proxy container determines the current primary service container based on the primary and backup status of each service container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the write requests sent by the client to the primary storage node corresponding to the primary service container. The proxy container also establishes a connection with the backup service container and forwards the read requests sent by the client to the backup storage node corresponding to the backup service container. The cloud-native database also includes a backup target sub-database corresponding to the target sub-database, service containers created for the multiple storage nodes included in the backup target sub-database, at least one proxy container and container orchestrator storage component; An asynchronous streaming replication connection channel is established between the primary service container of the target sub-database and the primary service container of the backup target sub-database. When a failure is detected in the cluster where the target sub-database is located, and the backup target subsystem switches to become the primary system, the primary service container of the backup target sub-database provides data storage services to the outside world.

4. The method as described in claim 3, characterized in that, The proxy container determines the current primary service container and backup service container based on the primary and backup status of each service container, which is included in the container status information of each container stored in the container orchestrator storage component. The proxy container establishes a connection with the primary service container and forwards the processing request sent by the client to the primary storage node corresponding to the primary service container. When the first service container, which is the primary service container, fails, and the second service container, which is the backup service container, switches to become the primary service container, the primary / backup status of the first service container stored in the container orchestrator storage component is changed to backup, and the primary / backup status of the second service container is changed to primary. After the proxy container obtains the primary / backup status of the second service container stored in the container orchestrator storage component, it forwards the processing request sent by the client to the storage node corresponding to the second service container.

Citation Information

Patent Citations

  • Database service method and system

    CN113515499A

  • Cloud native database service providing method, system, equipment and medium

    CN114466027A