Database access method and apparatus, and computer readable storage medium
By deploying a new client on the target computing node of the cloud database system and synchronizing the memory data of the old client, the business interruption problem caused by the database storage engine client upgrade is solved, achieving near-zero interruption and resource saving effects.
Patent Information
- Application Number
- PCT/CN2024/077615
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-17
- Filing Date
- 2024-02-19
- Publication Date
- 2024-09-26
AI Technical Summary
In cloud database systems, the client upgrade of the database storage engine usually causes user business interruption, with a long interruption time. Existing solutions such as manually switching the database SQL engine to other computing nodes take a long time and cannot effectively shorten the interruption. time.
Deploy a new client of the database storage engine on the target computing node, pause the old client, synchronize its memory data to the new client, and terminate the old client, so that access requests can continue to be processed when the client is upgraded, shortening business interruption time. .
It achieves near-zero interruption when upgrading the database storage engine client, reduces the impact on user business, saves computing resources, and shortens the time of the upgrade process.
Smart Images

Figure CN2024077615_26092024_PF_FP
Abstract
Description
Database access method, device and computer-readable storage medium
[0001] This application claims priority to the Chinese patent application with application number 202310264567.9 filed with the State Intellectual Property Office of China on March 17, 2023, and priority to the Chinese patent application with the invention name “Database access method, device and computer-readable storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of cloud technology, and in particular to a database access method, device, and computer-readable storage medium. Background Art
[0003] At present, users can process business through the cloud database system with the "storage and computing separation" architecture provided by cloud vendors. As shown in Figure 1, the cloud database system with the "storage and computing separation" architecture includes a database SQL engine 400 and a database storage engine 500. The computing node managed by the cloud computing platform 300 deploys the database SQL engine 400, and the client (client) of the database storage engine 500 is also deployed on the same computing node. The distributed storage 200 managed by the cloud computing platform 300 deploys the server of the database storage engine 500. The database SQL engine 400 can access the data in the distributed storage 200 through the database storage engine 500 (that is, the client and server of the database storage engine 500).
[0004] The database storage engine 500 server is typically deployed with multiple replicas in the distributed storage 200 managed by the cloud computing platform 300. This allows for upgrades on one server while other servers continue to provide services normally, ensuring zero interruption to user services during server upgrades. However, the database storage engine 500 client is deployed with a single replica in the computing device cluster 100 managed by the cloud computing platform 300. If the client is upgraded, user services will be interrupted, typically lasting more than 30 seconds.
[0005] Currently, to reduce the impact of database storage engine 500 client upgrades on user services, the database SQL engine 400 can be manually switched from its current compute node to another compute node before the client upgrade. This allows for communication using the clients of other database storage engines deployed on other compute nodes. However, manually switching the database SQL engine 400 to another compute node also takes a long time, and user services are still interrupted for a long time.
[0006] Summary of the Invention
[0007] The present application provides a database access method, device, and computer-readable storage medium, which can greatly shorten the interruption time of user services when the client of the database storage engine is upgraded, to near zero interruption, and reduce the impact on user services.
[0008] In a first aspect, a database access method is provided, which is applied to a cloud database system. The cloud database system includes a database SQL engine and a database storage engine. A client of the database storage engine is deployed on a target computing node managed by a cloud computing platform. One or more of a master node and a slave node of the database SQL engine are deployed on the target computing node. A server of the database storage engine is deployed on distributed storage managed by the cloud computing platform. The master node and the slave node of the database SQL engine access data in the distributed storage through the database storage engine. The database access method may specifically include the following steps:
[0009] The old client of the database storage engine on the target computing node receives the access request and accesses the data in the distributed storage through the server of the database storage engine based on the access request, where the access request includes one or more of the following: a read request or a write request from the master node of the database SQL engine on the target computing node, or a read request from a slave node of the database SQL engine on the target computing node;
[0010] Deploy a new client for the database storage engine on the target compute node. The new client version is later than the old client version.
[0011] Pause the old client of the database storage engine on the target computing node and synchronize the old client's memory data to the new client;
[0012] The new client of the database storage engine on the target computing node continues to process access requests to the distributed storage data based on the synchronized memory data;
[0013] Terminate the old client of the database storage engine on the target compute node.
[0014] In the above solution, when the old client of the database storage engine needs to be upgraded, a new client of the database storage engine is directly deployed on the target computing node. The old client is then paused and its memory data is synchronized with the new client, allowing the new client to continue processing access requests to distributed storage data based on the synchronized memory data. Since these processes are all performed within the target computing node, the time consumed is very short, usually far less than 30 seconds, or even less than 1 second. Therefore, the interruption time of user business can be greatly shortened during the client upgrade, to near zero interruption, which can effectively reduce the impact of the client upgrade on user business. Moreover, during the client upgrade process, the client's memory data will be synchronized, allowing the new client to continue processing access requests from the database SQL engine based on the synchronized data without affecting user business.
[0015] In addition, the above solution also terminates the old client of the database storage engine on the target computing node, so that during daily operation and maintenance, only one client is kept running on the target computing node, saving computing resources.
[0016] In one possible implementation, the port used by the new client of the database storage engine to communicate with the distributed storage is the port used by the old client of the database storage engine to communicate with the distributed storage. In this way, the communication port of the new and old clients can be shared, saving resources.
[0017] In one possible implementation, the method provided by the above-mentioned first aspect or any possible implementation of the first aspect also includes the following steps: deploying an upgrade condition corresponding to the old client of the database storage engine on the target computing node, and the upgrade condition is used to indicate that the old client of the database storage engine needs to be upgraded; in this case, the target computing node can deploy a new client of the database storage engine on the target computing node when the old client of the database storage engine triggers the upgrade condition.
[0018] In one possible implementation, the cloud database system is deployed in a public cloud, a private cloud, or a hybrid cloud.
[0019] In a second aspect, a database access device is provided, which is applied to a cloud database system. The cloud database system includes a database SQL engine and a database storage engine. A client of the database storage engine is deployed on a target computing node managed by a cloud computing platform. The target computing node deploys one or more of a master node and a slave node of the database SQL engine. A server of the database storage engine is deployed on distributed storage managed by the cloud computing platform. The master node and the slave node of the database SQL engine access data in the distributed storage through the database storage engine.
[0020] The database access device may specifically include: a receiving module, a deployment module and a processing module;
[0021] a receiving module, configured to receive an access request through an old client of a database storage engine on a target computing node, the access request including one or more of the following: a read request or a write request from a master node of a database SQL engine on the target computing node, or a read request from a slave node of a database SQL engine on the target computing node;
[0022] A processing module, configured to access data in distributed storage through a server of a database storage engine based on an access request;
[0023] The deployment module is used to deploy a new client of the database storage engine on the target computing node. The new client version is later than the old client version.
[0024] The processing module is further used to suspend the old client of the database storage engine on the target computing node and synchronize the memory data of the old client of the database storage engine to the new client of the database storage engine;
[0025] The processing module is further configured to continue processing the access request to the distributed storage data based on the synchronized memory data through the new client of the database storage engine on the target computing node;
[0026] The processing module is also used to terminate the old client of the database storage engine on the target computing node.
[0027] In a possible implementation, the port used by the new client of the database storage engine to communicate with the distributed storage is the port used by the old client of the database storage engine to communicate with the distributed storage.
[0028] In one possible implementation, a deployment module is used to deploy upgrade conditions corresponding to an old client of the database storage engine on a target computing node, where the upgrade conditions are used to indicate that the old client of the database storage engine needs to be upgraded; and a deployment module is used to deploy a new client of the database storage engine on the target computing node when the old client of the database storage engine triggers the upgrade conditions.
[0029] In one possible implementation, the cloud database system is deployed in a public cloud, a private cloud, or a hybrid cloud.
[0030] For the database access device provided by the second aspect and the relevant beneficial effects and descriptions of any implementation of the second aspect, please refer to the relevant beneficial effects and descriptions of the aforementioned first aspect and any implementation of the first aspect, and will not be repeated here.
[0031] In a third aspect, a computing device cluster is provided, wherein the computing device cluster includes at least one computing device, and each computing device in the at least one computing device includes a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory in the at least one computing device, so that the computing device cluster implements the method provided by the first aspect or any possible implementation of the first aspect.
[0032] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and the instructions are used to implement the method provided in the first aspect or any possible implementation of the first aspect.
[0033] In a fifth aspect, a computer program product is provided, comprising a computer program. When the computer program is read and executed by a computing device, the computing device executes the method provided in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] FIG1 is a schematic diagram of the structure of a cloud database system with a "storage and computing separation" architecture exemplified in this application;
[0035] FIG2 is a schematic diagram of a computing device cluster and distributed storage structure exemplified in the present application;
[0036] FIG3 is a flow chart of a database access method provided in an embodiment of the present application;
[0037] FIG4 is a schematic diagram of communication port sharing between new and old clients provided in an embodiment of the present application;
[0038] FIG5 is a schematic structural diagram of a database access device provided in an embodiment of the present application;
[0039] FIG6 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0040] FIG7 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0041] FIG8 is a schematic diagram of a connection method of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The technical solution provided in this application will be described below in conjunction with the accompanying drawings.
[0043] This application relates to a cloud database system with a "storage and computing separation" architecture, which can be used to receive services input by users (such as data computing services, face recognition services, log storage and query services, etc.), process the services to obtain processing results, and store the processing results or provide the processing results to users.
[0044] Refer to Figure 1, which is a structural diagram of a cloud database system with a "storage and computing separation" architecture exemplified in this application. As shown in Figure 1, the system includes: a cloud computing platform 300, a computing device cluster 100 and a distributed storage 200 managed by the cloud computing platform 300. The cloud database system also includes a database SQL engine 400 and a database storage engine 500. The database SQL engine 400 is deployed in the computing device cluster 100. The database storage engine 500 includes a client and a server. The client is deployed in the computing device cluster 100, and the server is deployed in the distributed storage 200. The two work together to implement the functions of the database storage engine 500.
[0045] Cloud computing platform 300 is used to receive user-entered business requests and rationally allocate computing resources (such as central processing units (CPUs)) in computing device cluster 100 based on the business requests to maximize computing resource utilization. Cloud computing platform 300 can be a standalone server (such as an X86 server or an ARM server), a desktop computer, a storage array controller, or a server cluster consisting of multiple servers, etc., and this application does not impose specific limitations.
[0046] Computing device cluster 100, also known as a computing cluster or computing node cluster, is responsible for processing services according to the scheduling of cloud computing platform 300. When processing services, computing device cluster 100 can access distributed storage 200 via the network, read data required by the service from distributed storage 200 for processing, or write data to distributed storage 200. As shown in Figure 2, computing device cluster 100 typically includes multiple computing nodes, and the computing nodes in computing device cluster 100 can communicate with each other. Computing nodes can be servers, desktop computers, storage array controllers, etc.
[0047] Distributed storage 200 is responsible for storing data and can provide persistent storage services. The storage service provided by distributed storage 200 can be an object storage service (OBS). When this storage service is an object storage service, distributed storage 200 can also be referred to as an object storage system. As shown in Figure 2, distributed storage typically includes multiple storage nodes, and the storage nodes in distributed storage 200 can communicate with each other. Storage nodes can be servers, desktop computers, or storage array controllers, etc.
[0048] Database SQL engine 400. When a computing node in computing device cluster 100 needs to process a service, the computing node will run its own deployed database SQL engine 400 to handle the service. Different computing nodes in computing device cluster 100 can deploy different database SQL engines, and different database SQL engines can be used to process different user services. As shown in Figure 2, database SQL engine 4001 is deployed on computing node 100A, and database SQL engine 4002 is deployed on computing node 100B.
[0049] Furthermore, as shown in FIG2 , database SQL engine 400 may include one or more master nodes and one or more slave nodes. The master nodes included in database SQL engine 400 may independently implement the functions of database SQL engine 400 or collaborate with the slave nodes to implement the functions of database SQL engine 400. For example, the slave nodes may assist the master node in reading data in distributed storage 200. As shown in FIG2 , database SQL engine 4001 includes one master node and one slave node, and database SQL engine 4002 includes one master node.
[0050] Database storage engine 500. When the database SQL engine 400 needs to access data in the distributed storage 200, the database SQL engine 400 accesses it through the database storage engine 500. Specifically, the database SQL engine 400 first sends the access request to the client of the database storage engine 500. Then, the client of the database storage engine 500 cooperates with the server of the database storage engine 500 to process the access request and complete the data access to the distributed storage 200.
[0051] In Figure 1 , the computing device cluster 100, cloud computing platform 300, and distributed storage 200 can communicate with each other via a communication network using any communication mechanism or standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.
[0052] In a specific implementation, the cloud database system shown in FIG1 may be a system deployed on a public cloud, a private cloud, or a hybrid cloud.
[0053] It should be understood that the cloud database system shown in FIG1 is merely an example. In actual applications, the cloud database system may include fewer or more modules.
[0054] Currently, in cloud database systems, the server side of the database storage engine 500 is typically deployed as multiple copies in the distributed storage 200 managed by the cloud computing platform 300. As shown in FIG2 , the server side of the database storage engine 5001 is deployed on both storage node 200A and storage node 200B. This allows for an upgrade of one server side (e.g., the server side of the database storage engine 5001 on storage node 200A) while the other servers (e.g., the server side of the database storage engine 5001 on storage node 200B) can continue to provide services normally, achieving zero interruption of user services when the server side of the database storage engine 500 is upgraded. However, the client side of the database storage engine 500 is deployed as a single copy in the computing device cluster 100 managed by the cloud computing platform 300. As shown in FIG2 , the client side of the database storage engine 5001 is only deployed on computing node 100A. If the client side is upgraded, user services will be interrupted, and the interruption duration is usually greater than 30 seconds.
[0055] Currently, to reduce the impact of database storage engine 500 client upgrades on user services, the database SQL engine 400 (including the master and slave nodes of the database SQL engine 400) can be manually switched from the current compute node to another compute node before the client upgrade. This allows for communication using the clients of other database storage engines deployed on other compute nodes. However, manually switching the database SQL engine 400 to another compute node also takes a long time, and user services are still interrupted for a relatively long time.
[0056] In order to solve the above problems, the present application provides a database access method and device, which can be applied to the cloud database system shown in Figure 1 above. When the client of the database storage engine 500 is upgraded, it can greatly shorten the interruption time of user business, reduce the impact on user business, and optimize the user's business processing experience.
[0057] Please refer to FIG3 , which is a flowchart of a database access method provided in an embodiment of the present application. As shown in FIG3 , the database access method provided in the present application includes the following steps:
[0058] S301: An old client of a database storage engine on a target computing node receives an access request sent by a database SQL engine.
[0059] The target computing node may be any computing node in the computing device cluster 100 shown in FIG. 2 .
[0060] The access request includes one or more of the following: a read request or a write request from a master node of a database SQL engine on a target computing node, and a read request from a slave node of a database SQL engine on a target computing node.
[0061] S302: The old client of the database storage engine accesses the data in the distributed storage through the server of the database storage engine based on an access request.
[0062] S303: Deploy a new client of the database storage engine on the target computing node, where the version of the new client is later than that of the old client.
[0063] Specifically, the deployment of the new client on the target computing node can be achieved by deploying a binary (BIN) file corresponding to the new client of the database storage engine on the target computing node.
[0064] S304: Pause the old client of the database storage engine on the target computing node and synchronize the memory data of the old client to the new client.
[0065] Specifically, the old client of the database storage engine may be set to a freeze mode on the target computing node to suspend the operation of the old client of the database storage engine.
[0066] The memory data of the old client may include data that the old client has accessed from the distributed storage based on the access request, the processing status of the access request, and the operation log of the old client itself.
[0067] S305: The new client of the database storage engine on the target computing node continues to process the access request to the distributed storage data based on the synchronized memory data.
[0068] S306: Terminate the old client of the database storage engine on the target computing node.
[0069] It can be understood that terminating the old client of the database storage engine on the target computing node can make the target computing node only need to operate and maintain the new client in the future, thereby saving resources and avoiding resource waste.
[0070] In a specific implementation, the old client of the database storage engine can also be terminated on the target computing node first. After that, the new client of the database storage engine continues to process access requests to distributed storage data based on the synchronized memory data. This application does not specifically limit the execution order of S305 and S306.
[0071] In a possible embodiment, in S305, when the new client of the database storage engine continues to process access requests to distributed storage data based on the synchronized memory data, the port (also called the network port) used by the new client to communicate with the distributed storage is different from the port used by the old client to communicate with the distributed storage.
[0072] In another possible embodiment, in S305, when the new client of the database storage engine continues to process access requests to the distributed storage based on the synchronized memory data, the port used by the new client to communicate with the distributed storage is the port used by the old client to communicate with the distributed storage. In other words, the old client will release the port it used to communicate with the distributed storage, and then the new client will use the port to communicate with the distributed storage. In this way, the communication ports of the new and old clients can be shared, saving resources. As shown in Figure 4, the network port number (network identity, NID) used by the new client to communicate with the distributed storage is the same as the NID used by the old client to communicate with the distributed storage, both of which are 12345.
[0073] Typically, the old client of the database storage engine will be restarted before being upgraded. In this application, in order to distinguish whether the old client of the database storage engine is restarted for an upgrade or a routine restart, an upgrade condition can be pre-configured for the upgrade and restart of the old client of the database storage engine before executing S303. The upgrade condition is used to indicate that the old client of the database storage engine needs to be upgraded. Then, in S303, when the old client of the database storage engine triggers the upgrade condition, a new client of the database storage engine can be deployed on the target computing node.
[0074] As can be seen from the embodiment of Figure 3, the database access method provided by this application performs the client upgrade process on the compute node internally. The entire process is very short, typically far less than 30 seconds, or even less than 1 second. Therefore, during the client upgrade, the interruption time of user services can be greatly shortened to near zero, effectively reducing the impact of the client upgrade on user services. Furthermore, during the client upgrade process, the client's memory data is synchronized, allowing the new client to continue processing access requests from the database SQL engine based on the synchronized data, without affecting user services.
[0075] In addition, in the database access method provided by this application, the old client of the database storage engine is also terminated on the computing node, so that during daily operation and maintenance, only one client is kept running on the computing node, saving computing resources.
[0076] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0077] The above describes in detail the database access method provided by the present application. Based on the same inventive concept, the following further introduces the database access apparatus and computing device cluster provided by the present application.
[0078] Refer to Figure 5, which is a structural diagram of a database access device 500 provided in an embodiment of the present application. The database access device 500 can be applied to the cloud database system shown in Figure 1, and specifically can be applied to the target computing node described above.
[0079] As shown in Figure 5 , database access device 500 includes a receiving module 510, a deployment module 520, and a processing module 530. The following describes the functions of each module of database access device 500 by way of example. It should be understood that the functions of each module described below are merely examples of functions that database access device 500 may have in some embodiments of this application, and this application does not limit the functions of each module.
[0080] Receiving module 510 is used to receive access requests through the old client of the database storage engine on the target computing node, and the access requests include one or more of the following: a read request or a write request from the master node of the database SQL engine on the target computing node, and a read request from the slave node of the database SQL engine on the target computing node.
[0081] The processing module 530 is configured to access data in the distributed storage through the server of the database storage engine based on the access request.
[0082] The deployment module 520 is used to deploy a new client of the database storage engine on the target computing node, where the version of the new client is later than that of the old client.
[0083] The processing module 530 is further configured to pause the old client of the database storage engine on the target computing node and synchronize the memory data of the old client of the database storage engine to the new client of the database storage engine.
[0084] The processing module 530 is further configured to continue processing the access request to the distributed storage data based on the synchronized memory data through the new client of the database storage engine on the target computing node.
[0085] The processing module 530 is further configured to terminate the old client of the database storage engine on the target computing node.
[0086] In a possible embodiment, the port used by the new client of the database storage engine to communicate with the distributed storage is the port used by the old client of the database storage engine to communicate with the distributed storage.
[0087] In one possible embodiment, the deployment module 520 is used to deploy the upgrade conditions corresponding to the old client of the database storage engine on the target computing node, and the upgrade conditions are used to indicate that the old client of the database storage engine needs to be upgraded; the deployment module 520 is used to deploy the new client of the database storage engine on the target computing node when the old client of the database storage engine triggers the upgrade conditions.
[0088] In a possible embodiment, the cloud database system is deployed in a public cloud, a private cloud, or a hybrid cloud.
[0089] In a specific implementation, the receiving module 510, the deployment module 520, and the processing module 530 can all be implemented via software or hardware. For example, the implementation of the processing module 530 will be described below using the processing module 530 as an example. Similarly, the implementation of the receiving module 510 and the deployment module 520 can refer to the implementation of the processing module 530.
[0090] As an example of a software functional unit, the processing module 530 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the processing module 530 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0091] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0092] As an example of a hardware functional unit, processing module 530 may include at least one computing device, such as a server. Alternatively, processing module 530 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0093] When processing module 530 includes multiple computing devices, the multiple computing devices can be distributed in the same region or in different regions. The multiple computing devices included in processing module 530 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in processing module 530 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0094] It should be noted that, in other embodiments, the processing module 530 can be used to execute any step in the database access method shown in Figure 3, the receiving module 510 can be used to execute any step in the database access method shown in Figure 3, and the deployment module 520 can be used to execute any step in the database access method shown in Figure 3. The steps that the receiving module 510, the deployment module 520, and the processing module 530 are responsible for implementing can be specified as needed. By respectively implementing different steps in the database access method shown in Figure 3 by the receiving module 510, the deployment module 520, and the processing module 530, all functions of the database access device 500 are realized.
[0095] The present application also provides a computing device 600, which can deploy the database access apparatus 500 shown in FIG5 . The operations and / or functions of each module in the computing device 600 are respectively for implementing the corresponding steps in the database access method shown in FIG3 .
[0096] As shown in FIG. 6 , a computing device 600 includes a processor 610 , a memory 620 , and a communication interface 630 , wherein the processor 610 , the memory 620 , and the communication interface 630 may be interconnected via a bus 640 .
[0097] The processor 610 can read the program code (including instructions) stored in the memory 620 and execute the program code stored in the memory 620, so that the computing device 600 executes the steps performed by the target computing node in the database access method provided in the embodiment of the present application shown in Figure 3, or causes the computing device 600 to deploy the database access device 500.
[0098] Processor 610 can be implemented in various forms, such as a CPU, or a combination of a CPU and a hardware chip. The hardware chip can be an ASIC, a programmable logic device (PLD), or a combination thereof. The PLD can be a CPLD, an FPGA, a GAL, or any combination thereof. Processor 610 executes various types of digitally stored instructions, such as software or firmware programs stored in memory 620, enabling computing device 600 to provide various services.
[0099] The memory 620 is used to store program code and is controlled by the processor 610 for execution. The program code may include one or more software modules, which may be the software modules provided in the embodiment of FIG. 5 , such as the receiving module 510 , the deploying module 520 , and the processing module 530 .
[0100] The memory 620 may include a volatile memory, such as a random access memory (RAM); the memory 620 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the memory 620 may also include a combination of the above types.
[0101] The communication interface 630 may be a wired interface (e.g., an Ethernet interface, a fiber optic interface, or other types of interfaces (e.g., an InfiniBand interface)) or a wireless interface (e.g., a cellular network interface or a wireless local area network interface) for communicating with other computing devices or apparatuses. The communication interface 630 may utilize a protocol suite based on the Transmission Control Protocol / Internet Protocol (TCP / IP), such as the Remote Function Call (RFC) protocol, the Simple Object Access Protocol (SOAP) protocol, the Simple Network Management Protocol (SNMP) protocol, the Common Object Request Broker Architecture (CORBA) protocol, and distributed protocols.
[0102] Bus 640 may be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a unified bus (UBus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), or the like. Bus 640 may be classified as an address bus, a data bus, a control bus, or the like. In addition to a data bus, bus 640 may also include a power bus, a control bus, and a status signal bus. However, for clarity, various buses are labeled as bus 640 in the figure. For ease of illustration, FIG6 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0103] The computing device 600 is used to execute the database access method provided in the embodiment of the present application shown in FIG3 . The specific implementation process is detailed in the above method embodiment and will not be repeated here.
[0104] It should be understood that computing device 600 is only an example provided in an embodiment of the present application, and computing device 600 may have more or fewer components than those shown in FIG. 6 , may combine two or more components, or may have different configurations of components.
[0105] The present application further provides a computing device cluster 700 , which can deploy the database access apparatus 500 shown in FIG. 5 . The operations and / or functions of each module in the computing device cluster 700 are respectively for implementing corresponding steps in the database access method shown in FIG. 3 .
[0106] As shown in FIG7 , the computing device cluster 700 includes at least one computing device 600. The memory 620 in one or more computing devices 600 in the computing device cluster may store the same instructions for executing the database access method shown in FIG3 . The computing device 600 may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device 600 may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0107] In some possible implementations, the memory 620 of one or more computing devices 600 in the computing device cluster 700 may also respectively store partial instructions for executing the database access method shown in FIG3 . In other words, the combination of one or more computing devices 600 may jointly execute instructions for executing the database access method shown in FIG3 .
[0108] It should be noted that the memories 620 in different computing devices 600 in the computing device cluster 700 may store different instructions, each for executing a portion of the functions of the database access apparatus 500. In other words, the instructions stored in the memories 620 in different computing devices 600 may implement the functions of one or more of the receiving module 510, the deployment module 520, and the processing module 530.
[0109] In some possible implementations, one or more computing devices 600 in the computing device cluster 700 can be connected via a network. The network can be a wide area network or a local area network, etc. Figure 8 shows a possible implementation. As shown in Figure 8, two computing devices 600A and 600B are connected via a network. Specifically, the connection to the network is made through the communication interface in each computing device. In this type of possible implementation, the memory 620 in the computing device 600A stores instructions for executing the functions of the receiving module 510 and the deployment module 520. At the same time, the memory 620 in the computing device 600B stores instructions for executing the functions of the processing module 530.
[0110] The connection method between the computing device cluster 700 shown in Figure 8 can be considered to be that the database access method provided in the embodiment of the present application needs to synchronize a large amount of memory data of the old client to the new client and process a large number of access requests, so it is considered to hand over the functions implemented by the processing module 530 to the computing device 600B for execution.
[0111] It should be understood that the functionality of the computing device 600A shown in FIG8 may also be implemented by multiple computing devices 600. Similarly, the functionality of the computing device 600B may also be implemented by multiple computing devices 600.
[0112] The present application also provides a computer program product comprising instructions, which may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the database access method shown in FIG3 .
[0113] The present application also provides a computer-readable storage medium, which can be any available medium that can be stored by a computing device or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a high-density digital video disc (DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the database access method shown in FIG3.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A database access method, characterized in that: The cloud database system includes a database SQL engine and a database storage engine, a target computing node managed by a cloud computing platform deploys a client of the database storage engine, the target computing node deploys one or more of a master node and a slave node of the database SQL engine, a distributed storage managed by the cloud computing platform deploys a server of the database storage engine, the master node and the slave node access data in the distributed storage through the database storage engine, and the method includes: An old client of the database storage engine on the target computing node receives an access request, and accesses the data in the distributed storage through the server of the database storage engine based on the access request, wherein the access request includes one or more of the following: a read request or a write request from a master node of the database SQL engine on the target computing node, and a read request from a slave node of the database SQL engine on the target computing node; Deploy a new client of the database storage engine on the target computing node, wherein the version of the new client is later than the version of the old client; Pause the old client of the database storage engine on the target computing node, and synchronize the memory data of the old client to the new client; The new client of the database storage engine on the target computing node continues to process the access request for data access to the distributed storage based on the synchronized memory data; An old client of the database storage engine is terminated on the target computing node.
2. The method according to claim 1, characterized in that The port used by the new client to communicate with the distributed storage is the port used by the old client to communicate with the distributed storage.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Deploying an upgrade condition corresponding to the old client on the target computing node, wherein the upgrade condition is used to indicate that the old client needs to be upgraded; The step of deploying a new client of the database storage engine on the target computing node includes: When the old client triggers the upgrade condition, a new client of the database storage engine is deployed on the target computing node.
4. The method according to any one of claims 1 to 3, characterized in that: The cloud database system is deployed in a public cloud, a private cloud or a hybrid cloud.
5. A database access device, characterized in that: The cloud database system includes a database SQL engine and a database storage engine, a target computing node managed by a cloud computing platform deploys a client of the database storage engine, the target computing node deploys one or more of a master node and a slave node of the database SQL engine, a distributed storage managed by the cloud computing platform deploys a server of the database storage engine, the master node and the slave node access data in the distributed storage through the database storage engine, and the device includes: A receiving module, configured to receive an access request through an old client of the database storage engine on the target computing node, wherein the access request includes one or more of the following: a read request or a write request from a master node of the database SQL engine on the target computing node, and a read request from a slave node of the database SQL engine on the target computing node; A processing module, configured to access the data in the distributed storage through the server of the database storage engine based on the access request; A deployment module, used to deploy a new client of the database storage engine on the target computing node, wherein the version of the new client is later than the version of the old client; The processing module is further used to suspend the old client of the database storage engine on the target computing node and synchronize the memory data of the old client to the new client; The processing module is further used to continue processing the access request to access the distributed storage data based on the synchronized memory data through the new client of the database storage engine on the target computing node; The processing module is further used to terminate the old client of the database storage engine on the target computing node.
6. The device according to claim 5, characterized in that The port used by the new client to communicate with the distributed storage is the port used by the old client to communicate with the distributed storage.
7. The device according to claim 5 or 6, characterized in that The deployment module is used to deploy the upgrade condition corresponding to the old client on the target computing node, and the upgrade condition is used to indicate that the old client needs to be upgraded; The deployment module is used to deploy a new client of the database storage engine on the target computing node when the old client triggers the upgrade condition.
8. The device according to any one of claims 5 to 7, characterized in that The cloud database system is deployed in a public cloud, a private cloud or a hybrid cloud.
9. A computing device cluster, characterized in that: It includes at least one computing device, each of which includes a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device, the computing device performs the method according to any one of claims 1 to 4.
11. A computer program product, characterized in that The computer program product comprises instructions, and when the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Database access method, system and device, storage medium and processor
CN112988879A
Data synchronization processing method, electronic equipment and storage medium
CN113934745A
Client software upgrading method and device
CN115774563A
Database system with database engine and separate distributed storage service
US20140279929A1
Cited By
Database linking method and device for distributed heterogeneous database
CN118885529A
Database management method, database management device and computing device cluster
CN119988355A
