Distributed database architecture system, metadata node and method thereof

The distributed database architecture system with a metadata node facilitates low-latency data access and flexible resource allocation by decoupling compute and storage nodes, addressing inefficiencies in existing systems through flexible scaling and rapid upgrades.

JP2026540071APending Publication Date: 2026-11-27プロトンベース·エイチケイ·リミテッド
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2026528076
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-09
Filing Date
2024-11-07
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing distributed database architectures face challenges in achieving low-latency and high-efficiency data access, as well as rapid upgrades and flexible allocation of compute and storage nodes, leading to inefficiencies in data processing and management.

Method used

A distributed database architecture system with a metadata node that records the correspondence between data blocks and storage locations, allowing flexible allocation and rapid scaling of compute and storage nodes, and supports multiple references for data streams to enable independent access and management of data stream lifecycles.

Benefits of technology

Enables low-latency data access, flexible allocation of resources, and rapid upgrades by decoupling compute nodes from storage nodes, improving performance and availability in handling large data volumes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026540071000001_ABST
    Figure 2026540071000001_ABST
Patent Text Reader

Abstract

This disclosure provides a distributed database architecture system, a metadata node, and a method thereof. The system is available for cloud services and includes a plurality of compute nodes, a plurality of storage nodes, and a metadata node. The metadata node records the correspondence between each data block into which each data stream is divided and the storage location for storing said data block, and records two or more references for a first data stream that is read by two or more compute nodes, where the storage location corresponding to the data block of each data stream is located in one or more storage nodes, and each reference is used so that each of the two or more compute nodes obtains the correspondence of the first data stream and reads the first data stream. The plurality of compute nodes read each data stream from the plurality of storage nodes based on the correspondence, or store each data stream in the plurality of storage nodes. The plurality of storage nodes each store one or more data blocks of each data stream in their corresponding storage locations.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to the field of distributed databases, and more specifically to a distributed database architecture system, a metadata node used in the distributed database architecture system, a method used in the distributed database architecture system, and a method for a metadata node used in the distributed database architecture system. [Background Art]

[0002] With the rapid development of the Internet and the increase in data volume and number of users, data analysis and processing are becoming increasingly important. Existing distributed database architectures still cannot achieve low-latency and high-efficiency access and rapid upgrades in many scenarios, leaving room for improvement. [Summary of the Invention]

[0003] In view of the above, the present disclosure provides a distributed database architecture system that can satisfy low-latency data access while realizing flexible allocation of compute nodes and storage nodes and rapid upgrade of the database system.

[0004] According to one aspect of the present disclosure, a distributed database architecture system is provided, comprising a plurality of compute nodes, a plurality of storage nodes, and a metadata node, wherein the metadata node records the correspondence between each of the one or more data blocks into which each data stream is divided and a storage location for storing each data block, the storage locations corresponding to one or more data blocks of each data stream are located in one or more of the plurality of storage nodes, and records two or more references for a first data stream that is read by two or more compute nodes, each reference is configured to be used by one of the two or more compute nodes to obtain the correspondence to the first data stream in order to read the first data stream, the plurality of compute nodes are configured to read each data stream from the plurality of storage nodes or to store each data stream in the plurality of storage nodes based on the correspondence to each data stream, and the plurality of storage nodes are configured to store one or more data blocks of each data stream in the storage locations corresponding to one or more data blocks.

[0005] Optionally, the metadata node is configured to further instruct multiple storage nodes to create a reference to the first data stream for the first compute node when the first compute node of two or more compute nodes needs to read the first data stream, to delete the reference to the first data stream for the first compute node when the first compute node no longer needs to read the first data stream, and to delete the first data stream when all references to the first data stream have been deleted.

[0006] Optionally, the metadata node is configured to, in response to a storage request from a second compute node among multiple compute nodes requesting the storage of a first data stream, allocate one or more first storage locations located on one or more first storage nodes among multiple storage nodes for one or more first data blocks obtained by partitioning the first data stream, return information on one or more first storage locations for storing one or more first data blocks to the second compute node, and record the correspondence between each of the one or more first data blocks and the first storage location for storing each first data block; the second compute node is configured to partition the first data stream into one or more first data blocks and, based on the information on one or more first storage locations, send corresponding first data blocks from the one or more first data blocks to the corresponding first storage node for each first storage location; and the first storage node is configured to store the first data blocks received from the second compute node in the corresponding first storage locations.

[0007] Optionally, the metadata node can also record information about newly added storage nodes and, in response to a request from a third compute node among multiple compute nodes that requests storage of data streams, it can be configured to assign storage locations, including those located on the newly added storage nodes, to the third compute node.

[0008] Optionally, the distributed database architecture system may further include control nodes, which are configured to send information about newly added storage nodes to the metadata nodes based on the newly added storage nodes.

[0009] Optionally, the distributed database architecture system further includes a control node, which is configured to control metadata nodes to schedule, based on the load distribution of multiple compute nodes, a second data stream processed by a fourth compute node among the multiple compute nodes to be processed by a fifth compute node among the multiple compute nodes, to generate a reference to the second data stream for the fifth compute node during the scheduling period, and to delete the reference to the second data stream for the fourth compute node after the scheduling is complete.

[0010] Optionally, the distributed database architecture system further includes a control node, which is configured to control metadata nodes to duplicate references to the data streams in the first data stream set for each compute node in a first compute node group for processing a first data stream set, and to generate references to the data streams in the first data stream set for each compute node in a new or existing second compute node group.

[0011] Optionally, the control node is configured to further control taking the first data stream set offline from the first compute node group, and the metadata node is configured to further remove references to the data streams from the first data stream set for each compute node in the first compute node group.

[0012] Optionally, the control node is further configured to control each compute node in the first compute node group to synchronize the data in memory with the memory of the compute nodes in the second compute node group.

[0013] Optionally, the control node is configured to control the metadata node to stop writing data to the first compute node group if the difference between the data in the memory of the first compute node group and the data in the memory of the second compute node group is less than a first predetermined threshold, or if the synchronization delay between the first compute node group and the second compute node group is below a second predetermined threshold, and after synchronization is complete, to control the second compute node group to come online and the first compute node group to go offline, and after synchronization is complete, to delete the references to the data streams of the first data stream set for each compute node of the first compute node group.

[0014] Optionally, the metadata node can be configured to store multiple replicas for each reference.

[0015] Optionally, multiple compute nodes may be deployed across multiple cloud services, and / or multiple storage nodes may be deployed across multiple cloud services.

[0016] According to another aspect of the present disclosure, a metadata node is provided for use in a distributed database architecture system including a plurality of compute nodes, a plurality of storage nodes, and a metadata node, wherein the metadata node records the correspondence between each of the one or more data blocks obtained by partitioning each data stream and a storage location for storing each data block, the storage locations corresponding to one or more data blocks of each data stream are located in one or more of the plurality of storage nodes, and records two or more references for a first data stream that is read by two or more compute nodes, and each reference is configured to be used by one of the two or more compute nodes to obtain a correspondence to the first data stream in order to read the first data stream.

[0017] Another aspect of the present disclosure provides a method for use in a distributed database architecture system including a plurality of compute nodes, a plurality of storage nodes, and a metadata node, the metadata node recording a correspondence between each of the one or more data blocks obtained by partitioning each data stream and a storage location for storing each data block, wherein the storage locations corresponding to one or more data blocks of each data stream are located in one or more of the plurality of storage nodes, and two or more references are recorded for a first data stream that is read by two or more compute nodes, each reference being used by one of the two or more compute nodes to obtain a correspondence to the first data stream in order to read the first data stream; the plurality of compute nodes reading each data stream from the plurality of storage nodes or storing each data stream in the plurality of storage nodes based on the correspondence to each data stream; and the plurality of storage nodes storing one or more data blocks of each data stream in the storage location resources corresponding to one or more data blocks.

[0018] Another aspect of the present disclosure provides a metadata node method for use in a distributed database architecture system including a plurality of compute nodes, a plurality of storage nodes, and a metadata node, the method comprising: recording a correspondence between each of one or more data blocks obtained by partitioning each data stream and a storage location for storing each data block, wherein the storage locations corresponding to one or more data blocks of each data stream are located in one or more of the plurality of storage nodes; and recording two or more references to a first data stream read by two or more compute nodes, wherein each reference is used by one of the two or more compute nodes to obtain a correspondence to the first data stream in order to read the first data stream.

[0019] According to the embodiments of this disclosure, the metadata node assigns a storage location, which may be located on a different storage node, to each data block of the data stream, thereby enabling decoupling and flexible scheduling between compute nodes and storage nodes. Furthermore, the metadata node records the correspondence between each data block of each data stream and the storage location where that data block is stored, enabling rapid retrieval of the stored data stream. Additionally, by generating multiple references for a single data stream and using each for a different compute node, different compute nodes can independently access the same data stream, enabling flexible allocation and rapid upgrades to the database, and the lifecycle of the data stream can be managed by the multiple references. [Brief explanation of the drawing]

[0020] To more clearly illustrate the embodiments of this disclosure or the technical solutions in the prior art, the following drawings, which may be used in the description of the embodiments or the prior art, are briefly introduced below. Clearly, the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these without any creative effort.

[0021] [Figure 1] Figure 1 shows the architecture of an existing distributed database. [Figure 2] Figure 2 is a schematic diagram showing the architecture system of a distributed database according to an embodiment of the present disclosure. [Figure 3] Figure 3 is a schematic diagram showing how a storage node, according to an embodiment of the present disclosure, stores a data stream in a data block manner at the storage location of each data block. [Figure 4] Figure 4 is a schematic diagram showing the relationship between a compute node, a metadata node, and a storage node according to an embodiment of the present disclosure. [Figure 5] Figure 5 is a schematic diagram illustrating the procedure for writing a single data stream according to an embodiment of the present disclosure. [Figure 6] Figure 6 is a schematic diagram illustrating how rapid read / write operations are performed after a new storage node is added, according to an embodiment of the present disclosure. [Figure 7] Figure 7 is a schematic diagram showing a rapid zero-copy multi-replica database architecture according to an embodiment of the present disclosure. [Figure 8] Figure 8 is a schematic diagram illustrating the procedure for a smooth upgrade based on a rapid database clone according to an embodiment of the present disclosure. [Figure 9] Figure 9 is a flowchart showing a method used in a distributed database architecture system according to an embodiment of the present disclosure. [Figure 10] Figure 10 is a flowchart showing a method used in a metadata node of a distributed database architecture system according to an embodiment of the present disclosure. [Description of Embodiments]

[0022] Hereinafter, examples of the present disclosure will be illustrated in the drawings with detailed reference to specific embodiments of the present disclosure. While the present disclosure will be described in conjunction with the specific embodiments, it should be understood that they are not intended to limit the present disclosure to the described embodiments. On the contrary, it is intended to cover alterations, modifications and equivalents included within the spirit and scope of the present disclosure as defined by the appended claims. It should be noted that the method steps described herein can be implemented by any functional block or functional configuration, and any functional block or functional configuration can be implemented as a physical entity or a logical entity, or a combination of both.

[0023] The architecture of the conventional distributed database is that a compute node and a storage node are coupled, and it is impossible to realize flexible allocation of the compute node and the storage node and rapid upgrade of the database system. For example, when modifying or expanding the compute node or the storage node, a large amount of data needs to be moved, which takes a long time. For example, a general database adopts a key-value scheme to store data, wherein one key is associated with one value as a unique identifier, and when querying, the storage position of the data is specified through the key, thereby specifying the data. However, such a database cannot immediately provide a write service to the storage node because keys need to be allocated to data when the storage node is expanded.

[0024] Figure 1 shows an existing distributed database architecture system 100. As shown in Figure 1, the distributed database architecture system 100 includes compute nodes 110 and storage nodes 120. One compute node 110 corresponds to each storage node 120, and the compute node 110 controls the reading and writing of data in the storage node 120. When a new storage node 121 is added to the compute node 110, or when a storage node 120 coupled to a compute node 110 is changed to a storage node 121, data writing services cannot be provided immediately in the storage node 121. Data writing services can only be provided in the storage node 121 after some of the database data has been moved from the existing storage node 120 to the storage node 121, which takes a long time. In addition, existing distributed database architectures using object storage cannot achieve low-latency access.

[0025] In light of the above, this disclosure provides a novel distributed database architecture system that can satisfy low-latency data access while enabling flexible allocation of compute and storage nodes and rapid upgrades of the database system. The distributed database architecture system of this disclosure is suitable for scenarios requiring the processing of large amounts of data and low-latency access, and provides users with high-performance, high-availability, and highly flexible database services. The distributed database architecture system of this disclosure can be implemented based on standard cloud service products provided by one or more cloud service providers.

[0026] Figure 2 is a schematic diagram showing the architecture system 200 of a distributed database according to an embodiment of the present disclosure.

[0027] The distributed database architecture system 200 may include multiple compute nodes 210, multiple storage nodes 220, and a metadata node 230. For illustrative purposes, Figure 2 shows only one compute node and one storage node. Optionally, the distributed database architecture system 200 may further include a control node 240. The control node 240 can be used to request cloud service resources from the cloud service provider to override the compute nodes 210, storage nodes 220, and metadata nodes 230, and can also perform a range of controls, such as load monitoring, node scaling in and out, and database upgrades and downgrades.

[0028] As shown in Figure 2, the compute node 210, storage node 220, and metadata node 230 may be located in cloud service resources provided by a cloud service provider. For example, the compute node 210 may be a compute resource allocated in the cloud service, and may be provided by any hardware with processing capabilities, such as a central processing unit (CPU). The storage node 220 may be a persistent storage resource allocated in the cloud service, and may be provided by any hardware with persistent storage capabilities, such as a magnetic hard drive and / or solid-state drive (SSD). The metadata node 230 may be a resource that provides metadata storage and processing in the cloud service, and may be provided by hardware with processing and storage capabilities, for example. The metadata node 230 may be implemented by a compute node and a storage node. The control node 240 may be any compute resource (for example, a compute resource allocated in the cloud service), and may be provided by any hardware with processing capabilities, such as a central processing unit (CPU). The control node 240 may be implemented in a compute node. The hardware providing the above resources may be combined with corresponding software to provide the service. According to embodiments of this disclosure, multiple compute nodes may be deployed in one or more cloud services. Multiple storage nodes may be deployed in one or more cloud services.

[0029] The metadata node 230 may be configured to record the correspondence between each of the one or more data blocks obtained by partitioning each data stream and the storage location for storing each data block. The storage locations corresponding to one or more data blocks of each data stream are located on one or more storage nodes.

[0030] In embodiments of this disclosure, a data stream refers to a sequence of data that has been streamed for transmission or storage. A data stream may be any form of stream, such as a character stream, a byte stream, or a bit stream. For example, accessing a database may typically involve converting data in the database into a data stream, such as a byte stream. A single data stream may represent a data stream corresponding to data stored through a single streaming process. For example, a single data stream may correspond to a data stream corresponding to a single record in a database (e.g., a data table). In embodiments of this disclosure, a database may be a set of data streams.

[0031] A data stream may be divided into one or more data blocks so that they are distributed and stored in units of data blocks at one or more storage locations on one or more storage nodes. Typically, a data block is a segment of a data stream, and a single data stream has multiple data blocks. In embodiments of this disclosure, the number of data blocks in a data stream may be arbitrary and there is no upper limit. If the data stream is relatively small, a single data stream may be divided into only one data block. The size of the data block may be determined according to the specific application scenario. Metadata nodes, compute nodes, and storage nodes all process based on the determined size of the data block. Each data block may be stored in one storage location. In embodiments of this disclosure, different data blocks may be stored in storage locations on the same or different storage nodes. If a single data stream is divided into multiple data blocks, different data blocks of a single data stream may be stored in storage locations on the same or different data nodes. Therefore, in embodiments of this disclosure, a single data stream may be stored on different storage nodes, enabling data stream distribution and flexible storage. Furthermore, compute nodes processing data streams may access multiple storage nodes, and the same storage node may be accessed by multiple compute nodes, thus disabling the coupling relationship between compute nodes and storage nodes. Also, since the data stream is data after it has been streamed, access to the data stream and the data blocks obtained by dividing it does not depend on key-value relationships. Therefore, when it is necessary to store data blocks of a data stream in a new storage node, it is not necessary to copy some of the data from other data nodes to the new data node, nor is it necessary to establish key-value relationships in the new data node. The data can be stored directly, enabling rapid scaling out of storage nodes.

[0032] To facilitate rapid reading of stored data streams, the metadata node 230 may record as metadata the correspondence between each of the one or more data blocks obtained by dividing each data stream and the storage location for storing each data block. In other words, the metadata node 230 records the storage location for storing the database corresponding to each data block on a data block basis; that is, the metadata in the embodiments of the present disclosure is data block-level metadata. For example, the correspondence may be a mapping relationship between an identifier of a data block in the data stream and an identifier of the storage location of that data block. The storage locations in the embodiments of the present disclosure may have different levels of granularity, such as storage node granularity, storage device granularity at a storage node, or a more specific storage location granularity at a storage device (storage disk, storage drive). If storage node granularity is adopted, the metadata node may assign and record only the storage node that stores a given data block, and the storage node may determine which specific storage device and which specific location within that storage device it stores the data in. In this case, the identifier of the storage location may include only the identifier of the storage node. When adopting storage device granularity at the storage node level, the metadata node allocates and records the storage node that stores a data block and the storage device that stores the data block at that storage node, and the specific location at that storage device may be determined by the storage node. In this case, the identifier of the storage location may include the identifier of the storage node and the identifier of the storage device at the storage node level. When adopting a more specific storage location granularity at the storage device level, the location identifier must include more specific storage location information in addition to the identifier of the storage node and the identifier of the storage device at the storage node.Based on the above correspondence, the location where a data stream is stored can be quickly identified, enabling rapid data retrieval. The method for realizing this correspondence is not limited to the specific embodiment described above, but is acceptable as long as it can achieve the above objective.

[0033] Tables 1 and 2 below show two examples of the above correspondence. Table 1 shows an example where the storage location is at the storage node granularity, and Table 2 shows an example where the storage location is at the storage device granularity.

[0034] [Table 1]

[0035] As shown in Table 1, data stream 1 is divided into three data blocks 1, 2, and 3. Of these, data blocks 1 and 2 are stored in storage node 1, and data block 3 is stored in storage node 2. Therefore, the correspondence may include the fact that data block identifiers 1, 2, and 3 corresponding to data stream identifier 1 correspond to storage nodes 1, 1, and 2, respectively. Similarly, data stream 2 is divided into two data blocks 1 and 2. Data block 1 is stored in storage node 1, and data block 2 is stored in storage node 2. Therefore, the correspondence may include the fact that data block identifiers 1 and 2 corresponding to data stream identifier 2 correspond to storage nodes 1 and 2, respectively.

[0036] [Table 2]

[0037] As shown in Table 2, data stream 1 is divided into three data blocks 1, 2, and 3. Data blocks 1 and 2 are stored in magnetic drives C and D (identifiable, for example, 1-C and 1-D, respectively) on storage node 1, and data block 3 is stored in magnetic drive C (identifiable, for example, 2-C) on storage node 2. Therefore, the correspondence may include the fact that data block identifiers 1, 2, and 3 corresponding to data stream identifier 1 correspond to storage location identifiers 1-C, 1-D, and 2-C, respectively. Data stream 2 is divided into two data blocks 1 and 2. Data block 1 may be stored in magnetic drive D (identifiable, for example, 3-D) on storage node 1, and data block 2 may be stored in magnetic drive C (identifiable, for example, 4-C) on storage node 2. Therefore, the correspondence may include the fact that data block identifiers 1 and 2 corresponding to data stream identifier 2 correspond to storage locations 3-D and 4-C, respectively.

[0038] Tables 1 and 2 above are merely examples of correspondences, and this disclosure is not limited thereto. Other forms of correspondences may be adopted. For example, the data stream identifiers and data block identifiers in Tables 1 and 2 above may be combined. For example, data block 1 of data stream 1 may be represented as data block 1-1, data block 2 of data stream 1 may be represented as data block 1-2, data block 3 of data stream 1 may be represented as data block 1-3, data block 1 of data stream 2 may be represented as data block 2-1, and data block 2 of data stream 2 may be represented as data block 2-2.

[0039] Optionally, such correspondences and other metadata in the metadata node may be replicated as multiple replicas, thereby ensuring metadata reliability and allowing another replica to provide the metadata if one replica fails. The metadata node may also assign one or more replicas of each data block to matching storage nodes based on a data redundancy policy. If a replica is missing, the metadata node may send a data block replication request to the storage node to satisfy the data redundancy policy.

[0040] Multiple compute nodes 210 are configured to read each data stream from multiple storage nodes based on the correspondence for each data stream, or to store each data stream in multiple storage nodes. According to an embodiment of this disclosure, a metadata node records the correspondence between one or more data blocks into which each data stream is divided and the storage locations where these data blocks are stored, and any of the multiple compute nodes can access the correspondence in the metadata node, so that any of the multiple compute nodes can access these data blocks of the data stream in the multiple storage nodes based on the said correspondence. Therefore, the coupling relationship between compute nodes and storage nodes is released, and one compute node can access multiple storage nodes as needed, and the same storage node may be accessed by multiple compute nodes as needed. This can be achieved by assigning a storage location for each data block of the data stream by the metadata node.

[0041] Regarding storage operations, the metadata node 230 can, based on a request from a compute node to store a data stream, allocate one or more storage locations for one or more first data blocks into which the data stream is divided, and return information about the allocated storage locations to the compute node. This allows the compute node to send the corresponding data blocks to the corresponding storage nodes based on the information of each storage location, thereby storing the database in the corresponding storage locations. As can be seen from this, the compute node is not limited to storage in fixed storage nodes, as it can store the corresponding data blocks in the corresponding data nodes based on the storage nodes allocated by the metadata node. The metadata node can flexibly allocate storage locations based on information such as the storage nodes in the system and their storage status. Furthermore, since the identifier information of the storage nodes is also included in the correspondence between the data blocks of the data stream and their storage locations, the compute node can determine the corresponding storage node based on the correspondence.

[0042] Regarding read operations, if a compute node wishes to read a data stream, it can obtain the correspondence between the data blocks and storage locations of that data stream from the metadata node, and then read each data block of that data stream from the corresponding storage location on the corresponding storage node, thereby reading the entire data stream.

[0043] Accordingly, multiple storage nodes 220 may be configured to store one or more data blocks of each data stream in storage locations corresponding to one or more data blocks. For example, a storage node that receives a request from a compute node to store a data block can store the data block at a storage address based on the storage location information included in the request. For example, if the storage location information includes information about a target storage device, the storage node stores the database on that target storage device, and the specific storage address is determined by the storage node's own storage policy. If the storage location information itself includes a more specific storage address, the storage node stores the database at the storage address included in the storage location information. If the storage location information includes only storage node information and no further information, the storage node determines the specific storage device and address based on its own storage policy.

[0044] Figure 3 is a schematic diagram illustrating an embodiment of the present disclosure in which a storage node stores a data stream in a data block storage resource using a data block method.

[0045] A storage node is a node that stores data and may include and manage storage media. The storage media may be any form of persistent storage media, such as magnetic hard drives or solid-state drives. The storage node stores data blocks at storage addresses within the storage media. The storage node can handle reading and writing data blocks, delete data blocks, handle replication requests, and check the integrity of data blocks to ensure data persistence and accuracy. The storage node supports multiple compute nodes reading data simultaneously (including reading the same data simultaneously).

[0046] As shown in Figure 3, the storage medium in the data node stores data streams in a data block manner. A single data stream may be divided into multiple data blocks and stored in multiple storage nodes. A correspondence exists between the data blocks into which the data stream is divided and the storage location where the data blocks are stored. In this way, a single data stream can be stored in different data nodes, enabling distributed and flexible storage of data streams. Furthermore, the same compute node can access multiple storage nodes, and the same storage node may be accessed by multiple compute nodes, thus disabling the coupling relationship between compute nodes and storage nodes and enabling flexible scheduling between compute nodes and storage nodes.

[0047] Returning to Figure 2, the metadata node 230 may also be configured to record two or more references to a first data stream that is read by two or more compute nodes. Each reference is used by one of the two or more compute nodes to obtain an association with the first data stream in order to read the first data stream. According to embodiments of this disclosure, multiple references can be generated for a single data stream, and since each reference is used for one compute node, multiple references can be used for multiple different compute nodes. A reference to a data stream indicates an association with that data stream, and may be, for example, an identifier for the data stream, which is associated with the data stream. Since the reference is associated with the data stream, an association can be obtained between the data blocks of the data stream and the storage location where the data blocks of the data stream are stored, and the data stream can be stored and read. Multiple references may be recorded for a single data stream, for example, multiple identifiers may be recorded for that data stream, each identifier being used for one compute node. The values ​​of these identifiers may be the same or different. When the same data stream has separate references (e.g., identifiers) for different compute nodes, it reflects the exclusive ownership of that data stream from the compute node's perspective. This means that if a compute node needs to read a data stream, it only needs to add one reference for that node. Conversely, if that compute node no longer needs to read the data stream, it can simply remove its reference. This allows for flexible allocation and rapid upgrades of the database.

[0048] Furthermore, the metadata node may manage the lifecycle of a data stream and the lifecycle of which compute node can access the data stream by providing different references to different compute nodes. Specifically, the metadata node is configured to generate a reference to the first data stream for a first compute node when the first compute node of two or more compute nodes needs to read the first data stream, to delete the reference to the first data stream for the first compute node when the first compute node no longer needs to read the first data stream, and to instruct multiple storage nodes to delete the first data stream when all references to the first data stream have been deleted.

[0049] The lifecycle of a data stream begins when the data stream is stored, i.e., from the time the metadata node generates the first reference until the data stream is deleted, i.e., until all references to that data stream are deleted. The lifecycle for each compute node accessing the data stream begins when that compute node needs to access the data stream, i.e., from the time a reference is generated for that compute node until that compute node no longer needs to access the data stream, i.e., until the reference for that compute node is deleted. By generating references for different compute nodes, the metadata node can clearly understand which compute nodes may access the data stream and manage the lifecycle of the data stream and the lifecycle of each compute node accessing the data stream.

[0050] Table 3 below shows an example of the above-mentioned references, but this disclosure is not limited to these.

[0051] [Table 3]

[0052] As shown in Table 3, for example, if both compute nodes 1 and 2 wish to access (read) data stream 1, a reference to data stream 1 is generated for compute node 1 (for example, with the identifier "Compute Node 1 - Data Stream 1"), and simultaneously, a reference to data stream 1 is generated for compute node 2 (for example, with the identifier "Compute Node 2 - Data Stream 1"). In this way, compute nodes 1 and 2 can access data stream 1 simultaneously. If both compute nodes 1 and 2 wish to access data stream 2, a reference to data stream 2 is generated for compute node 1 (for example, with the identifier "Compute Node 1 - Data Stream 2"), and simultaneously, a reference to data stream 2 is generated for compute node 2 (for example, with the identifier "Compute Node 2 - Data Stream 2"). In this way, compute nodes 1 and 2 can access data stream 2 simultaneously. The same applies to compute nodes 3 and 4, and their explanation is omitted here. Of course, the format of the reference is not limited to the formats shown in Table 3; the reference only needs to indicate which compute node to service and which data stream to read.

[0053] Optionally, the metadata node may also store multiple replicas per reference to satisfy data redundancy requirements, allowing reference information to be retrieved from other replicas if one replica fails.

[0054] Figure 4 is an exemplary schematic diagram showing the relationship between a compute node, a metadata node, and a storage node according to an embodiment of the present disclosure.

[0055] As shown in Figure 4, the metadata node 430 records the correspondence 437 between the multiple data blocks 4211, 4212, and 4221 from which the first data stream is divided, and multiple storage locations in the storage nodes 421 and 422 for storing the multiple data blocks 4211, 4212, and 4221 of the first data stream, and the correspondence 438 between the second data stream and multiple storage locations in the storage nodes 422 and 423 for storing the multiple data blocks 4222, 4231, and 4232 from which the second data stream is divided.

[0056] For example, correspondence 437 is used to store two data blocks 4211 and 4212 of the first data stream in storage node 421 and another data block 4221 in storage node 422. Accordingly, correspondence 437 may be used to read three data blocks 4211, 4212, and 4221 from storage nodes 421 and 422 to read the first data stream completely. Correspondence 438 is used to store two data blocks 4231 and 4232 of the second data stream in storage node 423 and another data block 4222 in storage node 422. Accordingly, correspondence 438 may be used to read three data blocks 4231, 4232, and 4222 from storage nodes 423 and 422 to read the second data stream completely.

[0057] In conventional distributed storage services, compute nodes and the storage nodes they can access are coupled, and a data stream processed by one compute node is not easily stored on multiple storage nodes. If a new storage node is added, data must be moved to the newly added storage node in order to couple it with existing compute nodes, which prevents rapid scaling out or migration. However, according to the embodiments of this disclosure, compute nodes and storage nodes can be flexibly allocated based on the relationship between data blocks and storage locations of data streams generated and recorded in metadata nodes.

[0058] Furthermore, as shown in Figure 4, the metadata node 430 may record two or more references as part of the metadata to a first data stream that is read by two or more compute nodes. Each reference is used so that each of the two or more compute nodes obtains the correspondence of the first data stream and reads the first data stream. The number of references to the first data stream may be the same as the number of compute nodes of the first data stream that are to be accessed, and one reference to the first data stream corresponds to one compute node of the first data stream that is to be accessed and is dedicated to that compute node for using that correspondence, so that each compute node can access the data using the reference independently without interfering with each other.

[0059] For example, metadata node 430 records multiple references 431, 432, 433, and 434, respectively, which compute nodes 411, 412, 413, and 414 use to obtain correspondences 437 for the first data stream and access each data block 4211, 4212, and 4221 of that data stream. References 431, 432, 433, and 434 all point to the same data stream (the first data stream) but are used by compute nodes 411, 412, 413, and 414, respectively. This allows each compute node 411, 412, 413, and 414 to simultaneously obtain correspondences 437 for each data block of the first data stream and access data blocks 4211, 4212, and 4221 in the first data stream simultaneously and independently. In other words, a single data stream may be accessed simultaneously by multiple compute nodes. From the perspective of compute nodes, multiple references reflect the fact that each compute node has its own data stream, thus having its own database, i.e., a set of data streams consisting of one or more data streams. From the perspective of databases, multiple references reflect the fact that the database is replicated as multiple databases in a zero-copy manner, each used by a different compute node. Different compute nodes each have their own reference, which allows for flexible allocation and rapid upgrades to the database compared to sharing the same reference.

[0060] Furthermore, a single compute node can access (i.e., read from) multiple data streams using multiple references to multiple data streams. For example, if compute node 413 attempts to access a first data stream and a second data stream, metadata node 430 generates a reference 433 for compute node 413 to access the first data stream and a reference 435 for accessing the second data stream.

[0061] The specific form of a reference can vary. For example, a reference may be an identifier for a data stream, associated with that data stream. A reference may also include an identifier for the compute node that will use the reference, indicating which compute node will use it. Of course, it may implicitly indicate which compute node will use the reference; for example, a reference recorded at a specific location implies that it is unique to a particular compute node, or the value of the reference itself implies that it is unique to a particular compute node. A reference may also include a correspondence between data blocks in a data stream and their storage locations, for example, the correspondence itself; that is, for each compute node attempting to access the data stream, a unique correspondence replica for that compute node may be recorded. The operation on a reference is purely metadata operation, not data copying, and can be completed quickly. After a reference to a data stream is generated for a compute node, that compute node will see a single, independent data stream through that reference. After all references to a data stream are released (i.e., deleted), the metadata node can manage the lifecycle of the data stream and the lifecycle of which compute nodes can access the data stream by reference by sending a delete request to the storage node where the data blocks contained in the data stream reside, and by deleting the metadata for the data stream and data blocks.

[0062] According to another embodiment of this disclosure, a single reference may be used by multiple compute nodes to read the same data stream, and if one compute node stops using the reference, the reference is not deleted but reserved for continued use by another compute node. For example, in one application scenario, if one compute node has high throughput to the data stream, other compute nodes may be temporarily created to distribute the throughput of that compute node using its reference. If distribution by other compute nodes is not necessary, the other compute nodes may be taken offline, but the reference to the data stream may be reserved for use by the single compute node.

[0063] According to embodiments of this disclosure, a metadata node assigns a storage location to each data block of a data stream, which may be located on a different storage node, thereby enabling decoupling between compute nodes and storage nodes and flexible scheduling. Furthermore, by recording the correspondence between each data block of each data stream and the storage location where that data block is stored, the stored data stream can be quickly read. Additionally, by generating multiple references for a single data stream, each for a different compute node, different compute nodes can independently access the same data stream, and furthermore, flexible allocation and rapid upgrades to the database can be achieved.

[0064] Figure 5 is a schematic diagram illustrating the procedure for writing a single data stream according to an embodiment of the present disclosure.

[0065] Figure 5 illustrates an example in which the second compute node 511 writes (stores) the first data stream. First, the second compute node 511 sends a storage request to the metadata node 530 requesting the storage of the first data stream.

[0066] The metadata node 530, in response to a storage request from the second compute node 510 requesting the storage of the first data stream, assigns one or more first storage locations located in one or more first storage nodes 521, 522 among multiple storage nodes to one or more first data blocks into which the first data stream has been divided, returns information about one or more first storage locations for storing one or more first data blocks to the second compute node 510, and records the correspondence between each of the one or more first data blocks and the first storage location for storing each first data block. For example, if the first data stream is divided into two data blocks, and the first data block is assigned to be stored in the first storage node 521, the metadata node 530 can return identifier information ID1 of the first storage node 521 for the first data block, and if the second data block is assigned to be stored in the first storage node 522, the metadata node 530 can return identifier information ID2 of the first storage node 522 for the second data block. Of course, if the aforementioned storage location includes a more specific storage location in addition to the storage node, the returned storage location information may also be information about that more specific storage location, for example, information about the storage device at the storage node.

[0067] The second compute node 510 divides the first data stream into one or more first data blocks (two data blocks in Figure 5) and, based on information of one or more first storage locations, transmits the corresponding first data blocks in one or more first data blocks to the first storage nodes 521 and 522 corresponding to each first storage location. For example, if the storage location of the first data block is located at the first storage node 521, when storing the first data block, the second compute node 510 transmits it to the first storage node 521 based on the identifier information ID1 of the first storage node 521. If the storage location corresponding to the second data block is located at the first storage node 522, when storing the second data block, the second compute node 510 transmits it to the first storage node 522 based on the identifier information ID2 of the first storage node 522.

[0068] In one embodiment, before the second compute node 510 transmits the corresponding data blocks to the corresponding first storage nodes 521 and 522, it may write the corresponding data blocks to memory until the data in memory reaches a predetermined amount, and the second compute node 510 may further asynchronously write the data blocks cached in memory to the first storage nodes.

[0069] Finally, the first storage nodes 521 and 522 store the first data block received from the second compute node 510 in the corresponding first storage location.

[0070] The following describes specific embodiments and technical effects relating to the embodiments of this disclosure in different scenarios.

[0071] Scenario 1 - Rapid scaling out of storage nodes Over time, the amount of data stored in a database can increase rapidly. If storage capacity becomes insufficient, the database will be unable to accept new data, causing the system to shut down or malfunction. Furthermore, approaching the database's storage capacity limit can impact database performance. Read and write operations may slow down, query response times may increase, and the user experience may deteriorate. Therefore, rapid scaling out of storage capacity is crucial for the smooth operation of the system, improved performance, and data security.

[0072] Therefore, when adding storage nodes to scale out storage capacity, the metadata node may be configured to record information about the newly added storage node and, in response to a request from a third compute node among the multiple compute nodes that requests the storage of a data stream, to assign a storage location to the third compute node that includes the storage location located at the newly added storage node. In one embodiment, the control node may provide the metadata node with information about the newly added storage node, i.e., the control node may be configured to send information about the newly added storage node to the metadata node based on the newly added storage node. In another embodiment, the newly added storage node itself may send its own information to the metadata node.

[0073] Figure 6 is a schematic diagram illustrating how to perform rapid read and write operations after adding a new storage node according to an embodiment of the present disclosure.

[0074] Assuming that a new storage node 623 has been added, compared to the conventional method which requires moving some data from the existing storage nodes 621 and 622 to the newly added storage node 623, according to the embodiment of this disclosure, without moving any data, the metadata node 630 may, in response to a request from a compute node 613 among the multiple compute nodes 611, 612, 613, and 614 that requests the storage of a data stream, assign a storage location to compute node 613 that includes a storage location located on the newly added storage node 623 to store data blocks 6231, 6232, and 6222 of the data stream. As shown in Figure 6, data blocks 6231 and 6232 are located on the newly added storage node 623, and data block 6222 is located on the existing storage node 622. Of course, all data blocks may also be stored on the newly added storage node 623. The metadata node 630 records the correspondence 638 between each data block of the data stream and the storage location in which each data block of the data stream is stored.

[0075] Furthermore, the metadata node 630 may record multiple references 635 and 636 for the data stream, respectively, which allow compute nodes 613 and 614 to obtain a correspondence 638 for the data stream and access the data stream.

[0076] Thus, based on the data stream storage and reading operations described above, the newly added storage node can immediately perform data stream storage operations and subsequent reading operations. Compared to the challenges of conventional database architectures that cannot immediately provide corresponding write services when scaling out storage nodes, according to the embodiment of this disclosure, the exposure to compute nodes in the storage layer is at the data block level abstraction, and a single data block may be allocated to be stored in any storage location on any storage node. Therefore, when a new storage node is added, such data block-level write services can be provided immediately.

[0077] Scenario 2 - Zero-copy dynamic load balancing As data is continuously written, the distribution of data streams contained in several databases (e.g., tables) across compute nodes changes, and the frequency of requests to different data also changes. Some compute nodes may need to process larger amounts of data, potentially leading to performance bottlenecks. According to the embodiments of this disclosure, a dynamic load balancing mechanism can be implemented without copying data blocks, thereby avoiding performance bottlenecks caused by data distribution.

[0078] Specifically, the control node is configured to control the metadata node to schedule, based on the load distribution of multiple compute nodes, that a second data stream processed by a fourth compute node among the multiple compute nodes will be processed by a fifth compute node among the multiple compute nodes; to generate a reference to the second data stream for the fifth compute node during the scheduling period; and to delete the reference to the second data stream for the fourth compute node after scheduling is complete.

[0079] For example, a control node can understand the load distribution of multiple compute nodes by obtaining the amount of reference data and the resulting load on each compute node, which are recorded in real time by each compute node. If the control node discovers that this load distribution is not optimal or is unbalanced, for example, that the load on some compute nodes is significantly higher than that on others, it needs to schedule some of the data streams (e.g., the second data stream) on the compute nodes with higher loads (e.g., the fourth compute node) to be processed by other compute nodes (e.g., the fifth compute node).

[0080] A reference to the second data stream is created for the fifth compute node, and after scheduling is complete, the fifth compute node does not need to copy or move the second data stream. It can take over the second data stream and delete the reference to the second data stream for the fourth compute node. In this way, by relying on the efficient data stream referencing mechanism provided by the metadata node, the system's performance bottleneck can be eliminated by rapidly taking over the data stream by other compute nodes based on zero data stream copying.

[0081] Furthermore, during the scheduling procedure, the original reference of the fourth compute node to the second data stream remains valid, and the fourth compute node can still access the second data stream. Therefore, the scheduling procedure does not affect the processing of read requests to the second data stream by the fourth compute node. After scheduling is complete, the user's read requests to the second data stream are automatically routed to the new fifth compute node, the existing reference of the fourth compute node is removed, and the fifth compute node takes over the second data stream completely.

[0082] Scenario 3 - Flexible realization of database resource sharing and exclusivity using compute node groups Database resource sharing can reduce hardware and software costs, while resource monopolization can ensure service stability and provide greater security. According to embodiments of this disclosure, two databases (data stream sets) may be assigned to the same compute node group and allowed to share resources within the same compute group (i.e., resource sharing), for example, references to the two databases may be read by the same compute node. Alternatively, the two databases may be assigned to two different compute node groups, physically ensuring their isolation (i.e., resource monopolization). Here, since one data entry in a database can be streamed as one data stream, one database may be represented by one data stream set, and one data stream set may contain one or more data streams.

[0083] According to the embodiments of this disclosure, a database can be migrated from one compute node group to another by zero-copying data blocks. This allows for rapid switching between shared and exclusive database resources.

[0084] Specifically, the control node may be configured to control the metadata node to duplicate references to the data streams in the first data stream set for each compute node in the first compute node group for processing the first data stream set, thereby generating references to the data streams in the first data stream set for each compute node in the existing second compute node group, and to control the first data stream set to be taken offline from the first compute node group. The metadata node may also be configured to delete references to the data streams in the first data stream set for each compute node in the first compute node group. In this way, the first data stream set can be migrated from the first compute node group to the second compute node group by zero-copying the data blocks, allowing the second compute node group to access the first data stream set and provide it to the outside.

[0085] Scenario 4 - A rapid zero-copy multi-replica architecture for databases When a database cannot satisfy user requests through horizontal scaling out, vertical scaling out becomes necessary. Traditional databases require a single physical copy of the data for scaling out. This approach is both wasteful of storage capacity and slow. According to embodiments of this disclosure, the service capacity of a database can be improved by having multiple compute nodes reference and serve the same data. In other words, according to embodiments of this disclosure, the objective of increasing the service capacity to process the database can be achieved by adding compute nodes without copying the data stream.

[0086] Figure 7 is a schematic diagram showing a rapid zero-copy multi-replica architecture for a database according to an embodiment of the present disclosure.

[0087] As shown in Figure 7, first, the control node 740 may request resources from the cloud to select or build a new compute node group 712, for example, the newly added second compute node group in the above embodiment. Specifically, the control node 740 may be configured to control the metadata node 730 to duplicate references to the data streams in the first data stream set for each compute node of the first compute node group 711 that processes the first data stream set (first database), and to generate references to the data streams in the first data stream set for each of the newly added second compute node groups 712.

[0088] Furthermore, in order to enable the newly added second compute node group 712 to obtain complete information about the first compute node group 711, the control node is further configured to control each of the first compute node group 711 so that the data in its memory is synchronized with the memory of the compute node in the second compute node group 712.

[0089] For example, the memory of the first compute node group 711 may contain data that is to be stored in the storage node. In order to fully synchronize the current processes of the first compute node group 711, the second compute node group 712 may retrieve the data from the memory of the first compute node group 711 and store it in its own memory in order to perform database operations based on the data in memory. After the memory of the second compute node group 712 retrieves the data from the memory of the first compute node group 711, it can read the data directly from its own memory, thereby improving the data reading speed. For example, as a synchronization method, the control node 740 may control the second compute node group 712 to retrieve current memory data from each compute node of the first compute node group 711 and load it synchronously into the memory of the second compute node group 712 by sending a network request.

[0090] Thus, the metadata node 730 simultaneously records references to the first data stream set of the first compute node group 711 and the first data stream set of the second compute node group 712, and the real-time data in memory is also synchronized. Therefore, both the first compute node group 711 and the second compute node group 712 can process the first data stream set, enabling rapid zero-copy multi-replica of the database.

[0091] Scenario 5 - Rapid cloning of a readable and writable database using zero-copy technology. Users desire to be able to quickly perform multiple different experiments on a single dataset during database usage procedures, while ensuring that these experiments do not interfere with one another. According to the embodiments of this disclosure, a single readable-write database can be quickly cloned with zero copies and provided to different business units for simultaneous experimentation. Users may then continue to submit new read / write requests to the newly cloned database, or clone a new database. This usage experience significantly improves the efficiency of iterative work and reduces usage costs.

[0092] According to embodiments of this disclosure, in order to rapidly clone a read-write database with zero copies, it is sufficient to create a new reference for all data streams in the database, which represents a new data block from the perspective of a compute node. When it is necessary to load this new data block into a compute node, the corresponding reference is assigned to that compute node.

[0093] Scenario 6 - Smooth Upgrade Based on Rapid Database Cloning Smooth database upgrades ensure system operation, reduce the risk of downtime and data loss, improve system availability and user experience, and can also lead to performance and functionality improvements. However, in conventional technologies, there is no particularly good solution for system upgrades where the state of each node must be coordinated with services, while guaranteeing a high Service Level Agreement (SLA) and reducing data storage and management costs.

[0094] Figure 8 is a schematic diagram illustrating the procedure for a smooth upgrade based on rapid database cloning according to an embodiment of the present disclosure.

[0095] As shown in Figure 8, the control node 860 receives a command from the client 850 and decides to upgrade from the first compute node group 811 to the second compute node group 812. The second compute node group 812 may be a compute node group newly requested by the control node 860 from the cloud service.

[0096] Similar to Scenario 4, the control node 860 may be configured to control the metadata nodes to duplicate references to the data streams in the first data stream set for each compute node in the first compute node group 811 that process the first data stream set, and to delete references to the data streams in the first data stream set for each compute node in the newly added second compute node group 812, and to control each compute node in the first compute node group 811 to synchronize the data in memory with the memory of the compute nodes in the second compute node group 812.

[0097] To improve the user experience and facilitate smooth database upgrades, the control node 860 may further control the first compute node group 811 to stop writing data to its memory if the difference between the data in the memory of the first compute node group 811 and the data in the memory of the second compute node group 812 is less than a first predetermined threshold, or if the synchronization delay between the first compute node group and the second compute node group falls below a second predetermined threshold, and after synchronization is complete, control the second compute node group 812 to come online and control the first compute node group 811 to come offline, and after synchronization is complete, control the metadata node to remove the references to the data streams of the first data stream set for each compute node of the first compute node group 811. In embodiments of this disclosure, a compute node coming online indicates that the compute node can perform read and write operations to the corresponding database.

[0098] The first or second predetermined threshold determines the duration of the write-block operation. A larger threshold results in a larger amount of data that needs to be synchronized after writing is stopped, and a longer synchronization time. A smaller threshold results in a smaller amount of data that needs to be synchronized after writing is stopped, and a shorter synchronization time. After synchronization is complete, the second compute node group is brought online, and subsequent data can be written by the second compute node group. For example, the data is first written to the memory of the second node group, and then stored in the storage node, or stored directly in the storage node. Therefore, from the user's perspective, write operations cannot be performed only during the period between the first compute node group stopping writing and the second compute node group completing synchronization and bringing it online. Thus, by setting an appropriate threshold, users cannot perform write operations within a very short time frame, thereby improving the user experience without making the user aware of the stop procedure.

[0099] For example, if the difference between the data in the memory of the first compute node group 811 and the data in the memory of the second compute node group 812 is small, the difference in the amount of data in the memory of the two compute node groups is small. In this case, the write process can be stopped, and the first compute node group can quickly synchronize the data with the small difference in memory to the memory of the second compute node group. As a result, the second compute node group can be quickly brought online after the synchronization is complete and continue with subsequent data writing operations. By setting an appropriate first threshold, the time required for this procedure is greatly reduced, improving the user experience by making the user hardly aware of the stop procedure.

[0100] Furthermore, for example, if the synchronization delay between the first compute node group 811 and the second compute node group 812 is low, the data in the memory of the first compute node group 811 and the data in the memory of the second compute node group 812 can be synchronized quickly, resulting in a small difference. In this case, it is suitable to stop the write operation of the first compute node group 811. Moreover, because the synchronization delay is small, the speed at which the differential data in memory is further synchronized is also fast, resulting in a shorter time for subsequent further synchronization. Therefore, it is suitable to stop the write operation of the first compute node group 811 to complete the synchronization between the first compute node group 811 and the second compute node group 812, providing a better user experience.

[0101] The first and second thresholds described above may be determined based on experience or experimentation as needed by the system. For example, the data difference or synchronization delay between two compute node groups may be determined as the first or second threshold, based on past experience, using the expected maximum duration of write operation interruption (e.g., 1 second) as a reference.

[0102] Furthermore, the difference between the data in the memory of the first compute node group and the data in the memory of the second compute node group, or the synchronization delay between the first compute node group and the second compute node group, can be determined by various technical means. For example, each compute node in the compute node group can monitor the data being written to memory and report the corresponding data to an aggregation node (e.g., a control node or a certain compute node), so that the aggregation node can determine the data difference in the memory of each compute node. Moreover, for example, the synchronization delay can be determined based on the difference between the time when a compute node in the first compute node group transmits data and the time when a compute node in the second compute node group receives that data. In embodiments of this disclosure, the synchronization delay represents the time difference between the transmission of data from one node and the complete reception of that data by another node, and includes the decoding and processing time when the data is received.

[0103] In the embodiments of this disclosure, the components and operations of a "compute node group" refer to the components and operations of a compute node within that compute node group. For example, the memory of a "first / second compute node group" refers to the memory of a compute node within the "first / second compute node group," which may be the memory of all compute nodes or the memory of a representative compute node. Furthermore, for example, the synchronization delay between the first compute node group and the second compute node group may be the average of the synchronization delays between all corresponding compute nodes in the two compute node groups, or the synchronization delay between one or more representative compute nodes in the two compute node groups.

[0104] The above procedure allows for a smooth upgrade of the database service from the first compute node group 811 to the second compute node group, without the need to actually copy the first data stream set (data blocks). Throughout this entire upgrade process, the database read service can be continuously provided to users, and the interruption of write operations is limited to a mere few seconds, providing users with a smooth experience without any noticeable lag.

[0105] Scenario 7 - Rapid database backup and recovery Database backups are a critical means of protecting data security and providing data recovery and disaster recovery capabilities, making them extremely important for ensuring business continuity and data reliability.

[0106] Traditional database backups require physically copying data, wasting a significant amount of storage space. Furthermore, the backup data needs to be copied again during the recovery phase, resulting in lengthy recovery times.

[0107] According to the embodiments of this disclosure, backups can be performed by simply adding a reference to the data, without actually copying the data, significantly saving storage space. Furthermore, in the database recovery procedure, the same reference technology can be used to associate compute nodes with the reference and load the backup into the compute node group, thereby significantly accelerating the database recovery procedure.

[0108] According to embodiments of the present disclosure, a metadata node used in a distributed database architecture system is provided, the distributed database architecture system comprising a plurality of compute nodes, a plurality of storage nodes, and a metadata node, wherein the metadata node records the correspondence between each data stream and one or more data block storage resources that store each data stream, the one or more data block storage resources are located in one or more of the plurality of storage nodes, and each of the one or more data block storage resources stores one of one or more data blocks into which each data stream is divided, and records two or more references to a first data stream that is read by two or more compute nodes, each reference is configured to be used by one of the two or more compute nodes to obtain a correspondence to the first data stream in order to read the first data stream.

[0109] The explanation regarding metadata nodes in the above description of the distributed database architecture system applies similarly here, so the explanation is omitted.

[0110] Figure 9 is a flowchart of Method 900 used in an architecture system of a distributed database according to an embodiment of the present disclosure. The architecture system of a distributed database includes a plurality of compute nodes, a plurality of storage nodes, and a metadata node. As shown in Figure 9, Method 900 includes steps 910 to 930.

[0111] In step 910, the metadata node records the correspondence between each of the one or more data blocks into which each data stream is divided and the storage location for storing each data block, and records two or more references for the first data stream which is read by two or more compute nodes, and each reference is used by one of the two or more compute nodes to obtain the correspondence to the first data stream in order to read the first data stream.

[0112] In step 920, multiple compute nodes either read each data stream from multiple storage nodes based on the correspondence between each data stream, or store each data stream in multiple storage nodes.

[0113] In step 930, multiple storage nodes store one or more data blocks of each data stream in the storage locations corresponding to one or more data blocks.

[0114] In some embodiments, Method 900 further includes the steps of: generating a reference to the first data stream for a first compute node in response that a metadata node wishes for a first compute node of two or more compute nodes to read the first data stream; deleting the reference to the first data stream for the first compute node in response that the first compute node does not need to read the first data stream; and instructing a plurality of storage nodes to delete the first data stream in response that all references to the first data stream have been deleted.

[0115] In some embodiments, Method 900 further includes the steps of: a metadata node responding to a storage request from a second compute node among a plurality of compute nodes that requests the storage of a first data stream, assigning one or more first storage locations located in one or more first storage nodes among a plurality of storage nodes to one or more first data blocks into which the first data stream has been divided, and returning information of one or more first storage locations for storing one or more first data blocks to the second compute node; recording the correspondence between each of the one or more first data blocks and the first storage location for storing each first data block; the second compute node dividing the first data stream into one or more first data blocks, and based on the information of one or more first storage locations, sending corresponding first data blocks from the one or more first data blocks to the corresponding first storage node for each first storage location; and the first storage node storing the first data blocks received from the second compute node in the corresponding first storage locations.

[0116] In some embodiments, the method 900 further includes the steps of having a metadata node record information about a newly added storage node, and in response to a request from a third compute node among a plurality of compute nodes that requests storage of a data stream, assigning to the third compute node a storage location that includes a storage location located on the newly added storage node.

[0117] In some embodiments, the distributed database architecture system further includes a control node. In this embodiment, method 900 further includes the step of the control node transmitting information about the newly added storage node to the metadata node based on the newly added storage node.

[0118] In some embodiments, the distributed database architecture system further includes a control node. In such embodiments, the method 900 further includes the steps of the control node scheduling a second data stream, which is processed by a fourth compute node among the plurality of compute nodes, to be processed by a fifth compute node among the plurality of compute nodes, based on the load distribution of the plurality of compute nodes; and controlling a metadata node to generate a reference to the second data stream for the fifth compute node during the scheduling period, and to delete the reference to the second data stream for the fourth compute node after the scheduling is complete.

[0119] In some embodiments, the distributed database architecture system further includes a control node. In such embodiments, method 900 further includes the step of controlling a metadata node by the control node to duplicate references to data streams from the first data stream set for each compute node in a first compute node group for processing a first data stream set, thereby generating references to data streams from the first data stream set for each compute node in a new existing second compute node group.

[0120] In some embodiments, Method 900 further includes the steps of controlling a control node to take a first data stream set offline from a first compute node group, and having a metadata node remove references to data streams from the first data stream set for each compute node in the first compute node group.

[0121] In some embodiments, Method 900 further includes the step of controlling a control node to synchronize data in the memory of each compute node in a first compute node group with the memory of a compute node in a second compute node group.

[0122] In some embodiments, Method 900 further includes the steps of: controlling a control node to stop writing data to its memory if the difference between the data in the memory of the first compute node group and the data in the memory of the second compute node group is less than a first predetermined threshold, or if the synchronization delay between the first compute node group and the second compute node group is below a second predetermined threshold; controlling the second compute node group to come online and the first compute node group to come offline after synchronization is complete; and controlling a metadata node to delete references to data streams in a first set of data streams for each compute node of the first compute node group after synchronization is complete.

[0123] In some embodiments, method 900 further includes the step of storing multiple replicas for each reference by a metadata node.

[0124] In some embodiments, multiple compute nodes are deployed in one or more cloud services, and / or multiple storage nodes are deployed in one or more cloud services.

[0125] The above description of the distributed database architecture system is also applicable to methods used in similar distributed database architecture systems.

[0126] Figure 10 is a flowchart of Method 1000 for metadata nodes used in a distributed database architecture system. The distributed database architecture system includes multiple compute nodes, multiple storage nodes, and metadata nodes. As shown in Figure 10, Method 1000 includes steps 1010-1020.

[0127] In step 1010, the metadata node records the correspondence between each of the one or more data blocks into which each data stream is divided and the storage location for storing each data block, and the storage location corresponding to one or more data blocks of each data stream is located in one or more of the storage nodes.

[0128] In step 1020, the metadata node records two or more references to a first data stream that is read by two or more compute nodes, and each reference is used by one of the two or more compute nodes to obtain a correspondence to the first data stream in order to read the first data stream.

[0129] The above description of the distributed database architecture system, metadata nodes, and methods used in the distributed database architecture system is also applicable to methods for metadata nodes.

[0130] As described above, each embodiment of the present disclosure enables decoupling and flexible scheduling between compute nodes and storage nodes, as well as rapid reading of stored data streams. Different compute nodes can independently access the same data stream, and further enable flexible allocation and rapid upgrades to the database. Each embodiment of the present disclosure can also solve problems such as rapid scaling out of storage nodes, data zero-copy dynamic load balancing by compute nodes, database resource sharing and exclusivity, rapid zero-copy multi-replica at the database granularity, rapid clone-readable and writable databases with data zero-copy, rapid and smooth upgrades of database clones, and rapid backup and recovery at the database granularity.

[0131] The above specific embodiments are merely examples and not intended to be limiting. Those skilled in the art can achieve the effects of this disclosure by integrating and combining several steps and apparatus from the individually described embodiments based on the concept of this disclosure. Such integrated and combined embodiments are also included in this disclosure, and a detailed explanation of such integration and combination is omitted here. Furthermore, the terms "first," "second," "third," and "fourth" in this disclosure are used to label one or more elements and do not indicate their importance or uniqueness, nor do they imply that they are different. For example, the first compute node and the second compute node may be different compute nodes or the same compute node.

[0132] The advantages, advantages, and effects mentioned herein are illustrative and not limitable, and these advantages, advantages, and effects are not necessarily present in each embodiment of this disclosure. Furthermore, the specific details disclosed herein are illustrative and not limitable, and are intended to facilitate understanding, and the details herein do not necessarily limit this disclosure to being realized by the specific details herein.

[0133] The block diagrams of the devices, apparatus, equipment, and systems relating to this disclosure are merely illustrative examples and are not intended to require or suggest that connections, arrangements, and configurations must necessarily be made in the manner shown in the block diagrams. A person skilled in the art will recognize that these devices, apparatus, equipment, and systems can be connected, arranged, and configured in any manner.

[0134] The flowcharts of the steps and the descriptions of the methods in this disclosure are for illustrative purposes only and do not require or imply that the steps of the embodiments must be performed in that order. As those skilled in the art will know, the steps in the embodiments can be performed in any order. For example, words such as "then," "then," and "next" do not limit the order of the steps. These words are merely to help the reader understand the description of those methods.

[0135] Each operation of the methods described above may be performed by any suitable means capable of performing the corresponding function. Such means may include, but are not limited to, hardware circuits, application-specific integrated circuits (ASICs), or processors, and may include a variety of hardware and / or software components and / or modules.

[0136] This disclosure may further include computer program products that can perform the methods, steps, and operations described herein. For example, such computer program products may be computer software packages, computer code instructions, and computer-readable media on which computer instructions for performing the operations described herein, when executed by a processor, are tangibly stored (and / or encoded).

Claims

1. A distributed database architecture system comprising multiple compute nodes, multiple storage nodes, and metadata nodes, The metadata node is Each data stream records the correspondence between each of the one or more data blocks into which it is divided and the storage location for storing each of the data blocks, and the storage location for each of the one or more data blocks for each data stream is located in one or more of the plurality of storage nodes. For a first data stream read by two or more compute nodes, two or more references are recorded, and each reference is configured to be used by one of the two or more compute nodes to obtain the correspondence to the first data stream in order to read the first data stream. The aforementioned multiple compute nodes are Based on the correspondence for each data stream, the system is configured to read each data stream from the plurality of storage nodes or to store each data stream in the plurality of storage nodes. The aforementioned multiple storage nodes are Each data stream is configured to store one or more data blocks in the storage locations corresponding to the one or more data blocks. A distributed database architecture system.

2. The metadata node further, Depending on whether the first compute node among the two or more compute nodes needs to read the first data stream, a reference to the first data stream is generated for the first compute node. In response to the first compute node no longer needing to read the first data stream, the reference to the first data stream for the first compute node is removed. The system is configured to instruct the multiple storage nodes to delete the first data stream in response to the deletion of all references to the first data stream. The distributed database architecture system according to claim 1.

3. The metadata node further, In response to a storage request from a second compute node among the plurality of compute nodes that requests the storage of the first data stream, one or more first storage locations located in one or more first storage nodes among the plurality of storage nodes are allocated for one or more first data blocks into which the first data stream has been divided. The information of the one or more first storage locations for storing the one or more first data blocks is returned to the second compute node. The system is configured to record the correspondence between each of the one or more first data blocks and a first storage location for storing each of the first data blocks. The second compute node described above is The first data stream is divided into one or more first data blocks, Based on the information of one or more first storage locations, the system is configured to transmit a corresponding first data block from among the one or more first data blocks to the first storage node corresponding to each first storage location. The first storage node is The first data block received from the second compute node is configured to be stored in the corresponding first storage location. The distributed database architecture system according to claim 1.

4. The metadata node is further configured to record information about newly added storage nodes and, in response to a request from a third compute node among the plurality of compute nodes that requests storage of a data stream, to assign a storage location to the third compute node, including a storage location located on the newly added storage node. The distributed database architecture system according to claim 1.

5. Further including control nodes, The control node is configured to transmit information about the newly added storage node to the metadata node based on the newly added storage node. The distributed database architecture system according to claim 4.

6. Further including control nodes, The control node is Based on the load distribution of the plurality of compute nodes, the second data stream processed by the fourth compute node among the plurality of compute nodes is scheduled to be processed by the fifth compute node among the plurality of compute nodes. The metadata node is configured to generate a reference to the second data stream for the fifth compute node during the scheduling period, and to delete the reference to the second data stream for the fourth compute node after the scheduling is completed. The distributed database architecture system according to claim 1.

7. Further including control nodes, The control node is The metadata node is configured to control the metadata node to duplicate the references to the data streams in the first data stream set for each compute node in a first compute node group for processing a first data stream set, thereby generating references to the data streams in the first data stream set for each compute node in a new or existing third compute node group. The distributed database architecture system according to claim 1.

8. The control node is further configured to control the first data stream set to be taken offline from the first compute node group. The metadata node is further configured to remove references to data streams in the first set of data streams for each compute node in the first compute node group. The distributed database architecture system according to claim 7.

9. The control node is further configured to control each compute node in the first compute node group so as to synchronize the data in memory with the memory of the compute nodes in the second compute node group. The distributed database architecture system according to claim 7.

10. The control node further If the difference between the data in the memory of the first compute node group and the data in the memory of the second compute node group is less than a first predetermined threshold, or if the synchronization delay between the first compute node group and the second compute node group falls below a second predetermined threshold, the first compute node group is controlled to stop writing data to its memory. After the synchronization is complete, the second compute node group is controlled to come online, and the first compute node group is controlled to come offline. After the synchronization is complete, the metadata node is configured to control the metadata node to remove the reference to the data streams in the first data stream set for each compute node in the first compute node group. The distributed database architecture system according to claim 9.

11. The metadata node is further configured to store multiple replicas for each reference. The distributed database architecture system according to claim 1.

12. The plurality of compute nodes are deployed in one or more cloud services, and / or The aforementioned multiple storage nodes are deployed in one or more cloud services. The distributed database architecture system according to claim 1.

13. A metadata node used in a distributed database architecture system, which includes multiple compute nodes, multiple storage nodes, and metadata nodes, The metadata node is Each data stream records the correspondence between each of the one or more data blocks into which it is divided and the storage location for storing each data block, and the storage location for each of the one or more data blocks for each data stream is located in one or more of the multiple storage nodes. For a first data stream read by two or more compute nodes, two or more references are recorded, and each reference is configured to be used by one of the two or more compute nodes to obtain the correspondence to the first data stream in order to read the first data stream. Metadata node.

14. A method used in a distributed database architecture system that includes multiple compute nodes, multiple storage nodes, and metadata nodes, The aforementioned method, The aforementioned metadata node, Each data stream records the correspondence between each of the one or more data blocks into which it is divided and the storage location for storing each data block, and the storage location for each of the one or more data blocks for each data stream is located in one or more of the multiple storage nodes. For a first data stream read by two or more compute nodes, two or more references are recorded, and each reference is used by one of the two or more compute nodes to obtain the correspondence to the first data stream in order to read the first data stream. The aforementioned plurality of compute nodes, Based on the correspondence relationship for each data stream, read each data stream from the plurality of storage nodes, or store each data stream in the plurality of storage nodes. With the aforementioned multiple storage nodes, Each data stream is stored in the storage location corresponding to the one or more data blocks, A method that includes this.

15. A method used for a metadata node in a distributed database architecture system including multiple compute nodes, multiple storage nodes, and the metadata node, The aforementioned method, The method of recording the correspondence between each of the one or more data blocks into which each data stream is divided and the storage location for storing each of the data blocks, wherein the storage location for each of the one or more data blocks for each data stream is located in one or more of the plurality of storage nodes. Recording two or more references to a first data stream read by two or more compute nodes, wherein each reference is used by one of the two or more compute nodes to obtain the correspondence to the first data stream in order to read the first data stream, Methods that include...