Data system

By designing that the memory layer and the computing layer in the data system are independent of each other and can share memory resources, the problem that existing shared databases cannot share memory resources is solved, and higher memory resource utilization and read and write performance of the data system are achieved.

CN119847766AActive Publication Date: 2025-04-18BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510322401.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-04-18
Estimated Expiration
2045-03-18

AI Technical Summary

Technical Problem

Existing shared databases cannot share memory resources between database instances, resulting in low memory resource utilization and waste.

Method used

A data system is designed, including a computing layer, a memory layer and a persistent storage layer. The computing layer and the memory layer are in a cluster form, and the memory layer and the computing layer are independent of each other. The memory layer can be accessed by all computing nodes of the computing layer, thereby realizing the sharing of memory resources between all computing nodes.

Benefits of technology

Through the sharing of memory resources, the utilization rate of memory resources in the system is improved, and the read and write performance of the data system is further improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847766A_ABST
    Figure CN119847766A_ABST
Patent Text Reader

Abstract

The present specification provides a data system, the system comprising: a computing layer comprising a plurality of computing nodes, each computing node being in communication connection with a memory layer, the computing layer being used for writing data into the memory layer based on a write request of a client or reading data from the memory layer based on a read request of the client; the memory layer comprises a plurality of memory nodes, each memory node is in communication connection with the persistent storage layer, and the memory layer is used for receiving the data written by the computing layer and dumping the data written by the computing layer to the persistent storage layer; the persistent storage layer is used for loading corresponding data in the persistent storage layer in response to a read request of the computing layer and sending the corresponding data to the computing layer; and the persistent storage layer is used for receiving and storing the data dumped by the memory layer and sending the corresponding data to the memory layer in response to the loading request of the memory layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of database technology, and in particular, to a data system. Background Art

[0002] In the field of modern information technology, databases play a vital role as core components of data storage and management. With the explosive growth of data and the increasing complexity of business needs, database technology continues to develop and evolve. As an important database architecture, shared databases formed by technologies such as object storage allow multiple users or applications to access and share the same data resources at the same time, greatly improving data utilization efficiency and business collaboration capabilities.

[0003] However, the shared database in the related art can only share persistent data, but the memory resources between database instances cannot be shared, resulting in low memory resource utilization of the database instance and waste. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a data system.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions: According to a first aspect of one or more embodiments of this specification, a data system is provided, the data system comprising: A computing layer, including a plurality of computing nodes, each computing node is in communication connection with the memory layer, and the computing layer is used to write data to the memory layer based on a write request of a client or read data from the memory layer based on a read request of a client; A memory layer, including a plurality of memory nodes, each memory node being in communication connection with a persistent storage layer, the memory layer being used to receive data written by the computing layer, and to dump the data written by the computing layer to the persistent storage layer, and to load corresponding data in the persistent storage layer in response to a read request of the computing layer, and to send the corresponding data to the computing layer; The persistent storage layer is used to receive and save the data dumped by the memory layer, and to respond to the loading request of the memory layer and send the corresponding data to the memory layer.

[0006] In a possible embodiment of the present specification, the computing layer is used to write the data indicated by the write request into a memory table of the local memory, and transfer the data in the memory table of the local memory to the memory table of the memory layer.

[0007] In a possible embodiment of the present specification, the computing layer is also used to dump the memory table of the local memory to the local disk to form an ordered string table, and convert the data in the ordered string table in the local disk into the data format of the memory table, and then transfer it to the memory table of the memory layer.

[0008] In a possible embodiment of the present specification, the plurality of computing nodes of the computing layer include a master node and at least one follower node; The master node is used to generate a write-ahead log based on the write request, synchronize the write-ahead log to each follower node and the persistent storage layer, and replay the write-ahead log to write data to a memory table in a local memory; The follower node is used to save the write-ahead log sent by the master node.

[0009] In a possible embodiment of the present specification, the memory layer is used to allocate space for the data transferred by the computing layer when the computing layer transfers data to the memory layer, save the data transferred by the computing layer in the allocated space, and return the address of the allocated space to the computing layer.

[0010] In a possible embodiment of the present specification, the computing layer is used to read the data indicated by the read request in the local memory and the local disk, send the data indicated by the read request to the client when the data indicated by the read request is successfully read, forward the read request to the memory layer when the data indicated by the read request is not successfully read, and save the data returned by the memory layer in the local memory; The memory layer is used to read the data indicated by the read request from the memory table and read cache data in the memory layer, send the data indicated by the read request to the computing layer when the data indicated by the read request is successfully read, send a load request to the persistent storage layer when the data indicated by the read request is not successfully read, save the data returned by the persistent storage layer into the read cache data and send it to the computing layer, wherein the data indicated by the load request is the same as the data indicated by the read request; The persistent storage layer is used to send the data indicated by the load request to the memory layer.

[0011] In a possible embodiment of the present specification, when the memory layer is used to save the data returned by the persistent storage layer into the read cache data, space is allocated for the data returned by the persistent storage layer, and the data returned by the persistent storage layer is saved into the allocated space so that the allocated space is added to the read cache data.

[0012] In a possible embodiment of the present specification, when allocating space, the memory layer uses a data block as the allocated space and records address information of the data block in a data block address table.

[0013] In a possible embodiment of the present specification, when the memory layer allocates space, if the capacity of the idle space does not meet the preset requirement, the idle space is increased according to at least one of the following: Dumping the memory table to the persistent storage layer; Delete part or all of the data in the read cache data.

[0014] In a possible embodiment of the present specification, the computing layer is used to load part or all of the read cache data of the memory layer to the added computing node after adding the computing node; The computing layer is used to load part or all of the read cache data of the memory layer to any computing node after the computing node is restarted.

[0015] In a possible embodiment of the present specification, after any computing node of the computing layer switches from a follower node to a master node, the computing node is used to load the write-ahead log in the persistent storage layer to the local computer, and replay the log after the write time in the write-ahead log to write the data after the write time to the memory layer, wherein the write time is used to represent the end time of the data written in the memory layer.

[0016] In a possible embodiment of the present specification, the memory layer is used to determine the data range of any memory node after the memory node goes offline, load the write-ahead log in the persistent storage layer to the memory layer, and replay the portion of the write-ahead log corresponding to the data range to load the data within the data range to other memory nodes.

[0017] In a possible embodiment of the present specification, each computing node of the computing layer is integrated into the same device with a memory node of the memory layer; or, each memory node of the memory layer is a device independent of all computing nodes in the computing layer.

[0018] In a possible embodiment of the present specification, the persistent storage layer includes a local storage layer and / or an object storage layer.

[0019] The technical solutions provided by the embodiments of this specification may have the following beneficial effects: The data system provided in the embodiments of this specification includes a computing layer, a memory layer and a persistent storage layer. The computing layer can write data to the memory layer based on a write request from a client, or read data from the memory layer based on a read request from a client. The memory layer can save the data written by the computing layer and dump it to persistent storage, and load the corresponding data in the persistent storage layer in response to the read request of the computing layer to send the corresponding data to the computing layer. The persistent storage layer can save the data dumped by the memory layer and send the corresponding data to it in response to the load request of the memory layer. It can be seen that the computing layer and the memory layer in the system are both in the form of clusters, which is conducive to expansion and resource utilization; and the memory layer and the computing layer are independent of each other, and the memory layer can be accessed by all computing nodes of the computing layer, thereby achieving the effect of sharing memory resources in the system among all computing nodes, improving the utilization rate of memory resources in the system, and further improving the read and write performance of the data system. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a structural diagram of a data system provided by an exemplary embodiment.

[0021] Figure 2 A data architecture of a memory layer provided by an exemplary embodiment.

[0022] Figure 3 It is a schematic diagram of a data system writing data provided by an exemplary embodiment.

[0023] Figure 4 It is a schematic diagram of a data system reading data provided by an exemplary embodiment.

[0024] Figure 5 It is a structural schematic diagram of a device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0026] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0027] First, some concepts involved in this specification are explained.

[0028] LSM-Tree: Log-Structured Merge Tree, an efficient storage structure widely used in database systems, is designed to optimize write performance and disk space utilization; it reduces the overhead of random writes by caching write operations in memory and periodically merging data to disk.

[0029] Object storage: Object storage is a data management architecture that treats data as objects rather than files or blocks to efficiently and flexibly store and retrieve massive amounts of unstructured data. Its "everything is an object" concept emphasizes that all data, whether it is documents, pictures, videos or logs, can be processed as objects, which helps improve access efficiency and scalability.

[0030] Under the shared storage architecture in the related technology, the computing resources and memory resources of each database instance are bound and strongly coupled together, so the computing resources and memory resources cannot be expanded independently. When one of them is expanded, the other must be expanded synchronously, which results in a waste of resources.

[0031] Based on the above technical problems, at least one embodiment of this specification provides a data system, which can be implemented based on an LSM-Tree (Log-Structured Merge Tree) storage engine.

[0032] Please refer to the attached Figure 1, the data system includes a computing layer, a memory layer and a persistent storage layer. The computing layer includes a plurality of computing nodes, each computing node is communicatively connected to the memory layer, and the computing layer is used to write data to the memory layer based on a write request from a client or to read data from the memory layer based on a read request from a client. The memory layer includes a plurality of memory nodes, each memory node is communicatively connected to the persistent storage layer, and the memory layer is used to receive the data written by the computing layer, and dump the data written by the computing layer to the persistent storage layer, and to load the corresponding data in the persistent storage layer in response to the read request of the computing layer, and send the corresponding data to the computing layer; the persistent storage layer is used to receive and save the data dumped by the memory layer, and to send the corresponding data to the memory layer in response to the load request of the memory layer.

[0033] Among them, the computing layer and the memory layer are both in the form of clusters, that is, multiple nodes form a consensus protocol group, such as a Paxos protocol group, and the master node leader in the protocol group is used for external interaction and internal management. For example, there are multiple data partitions in the computing layer, and each data partition has copies on some or all of the computing nodes in the computing layer. All copies of each data partition form a consensus protocol group and elect a leader copy. The leader copy serves as the master node of the data partition for external interaction and internal management; in other words, the master node in the computing layer can be the master node of each data partition it contains, and the master nodes of these data partitions overlap or do not overlap. It is preferred that the master nodes of different data partitions are different computing nodes of the computing layer, so that the computing pressure can be shared and balanced. For another example, a consensus protocol group is formed between multiple memory nodes in the memory layer and a master node is elected. The master node can manage all memory resources in the inner layer, such as allocating space, releasing space, etc. The master node can also interact with the outside, that is, interact with the computing nodes of the computing layer, interact with the persistent storage layer, etc.

[0034] The computing node has a local cache, which is divided into local memory and local disk. Taking one of the data partitions contained in the computing layer as an example, the multiple computing nodes of the computing layer include a master node and at least one follower node. The following description of the computing layer takes one of the data partitions contained in it as an example, and the content described is applicable to each data partition contained in it.

[0035] The memory layer can have a memory table MemTable and read cache data Micro Cache; the memory table is the write cache data, which is used to store the data written by the computing layer, and the read cache data is used to store the data loaded from the persistent storage device to the memory layer. Figure 2, the memory resources in the memory layer can be divided into multiple Slabs according to specific capacity, and these Slabs are distributed on different memory nodes; when the data system allocates memory space to different tenants, Slab can be used as the allocation unit. The space in Slab can be divided into multiple data blocks Chunks, and data blocks Chunks can be divided into multiple types according to capacity. When the memory layer allocates memory space for write cache data and read cache data, data blocks Chunks can be used as allocation units. For example, the capacity of Slab is 1GB, and the capacity of Chunks is 16KB, 32KB, 2MB, etc.

[0036] The memory layer has a Slab Address Table that records the address of each Slab. The address of a Slab may include the number (such as the number) and physical address of the memory node where the Slab is located, as well as the address of the Slab in the memory node, the tenant to which the Slab belongs, and the data partition. The Slab Address Table may have a copy in each memory node of the memory layer to ensure its high availability.

[0037] The memory layer has a data block address table (Chunk AddressTable) that records the address of each data block Chunk. The address of the data block Chunk may include the identifier (such as a label) and physical address of the Slab where the data block Chunk is located, as well as the reference count of the data block Chunk, that is, the number of times the Chunk is referenced; the data block address table may have a copy in each memory node of the memory layer to ensure its high availability.

[0038] The memory layer and the computing layer can communicate via RDMA (Remote Direct Memory Access), that is, each computing node is connected to each memory node via RDMA. The data transferred from the computing layer to the memory layer or the forwarded request is processed by the master node of the memory layer.

[0039] For example, each computing node of the computing layer is integrated with a memory node of the memory layer on the same device. In other words, each database instance in the data system has memory resources and computing resources, and different database instances share memory resources, that is, the computing resources of each database instance can access the memory resources on the same device and the memory resources on other database instances; the memory resources of these database instances form a consensus protocol group as the memory layer, and the computing resources of these database instances form a consensus protocol group as the computing layer.

[0040] For another example, each memory node in the memory layer is a device independent of all computing nodes in the computing layer. In other words, multiple devices with computing resources as the main component form a consensus protocol group as the computing layer; multiple devices with memory resources as the main component form a consensus protocol group as the memory layer. In this example, the memory layer is completely independent of the computing layer, making it easier to expand independently, and the utilization rate of memory resources is higher.

[0041] The persistent storage layer may include a local storage layer and / or an object storage layer. The local storage layer may also include multiple storage nodes, each storage node may be integrated with a memory node in the same device, or integrated with a computing node in the same device, or independent of all memory nodes and the computing nodes. The object storage layer forms a sharing of persistent devices between different database instances.

[0042] If the persistent storage layer includes a local storage layer and an object storage layer, when the memory layer dumps data, it can first dump the data to the local storage layer, and then upload the data from the local storage layer to the object storage layer directly or after merging.

[0043] The data system provided in the embodiments of this specification includes a computing layer, a memory layer and a persistent storage layer. The computing layer can write data to the memory layer based on a write request from a client, or read data from the memory layer based on a read request from a client. The memory layer can save the data written by the computing layer and dump it to persistent storage, and load the corresponding data in the persistent storage layer in response to the read request of the computing layer to send the corresponding data to the computing layer. The persistent storage layer can save the data dumped by the memory layer and send the corresponding data to it in response to the load request of the memory layer. It can be seen that the computing layer and the memory layer in the system are both in the form of clusters, which is conducive to expansion and resource utilization; and the memory layer and the computing layer are independent of each other, and the memory layer can be accessed by all computing nodes of the computing layer, thereby achieving the effect of sharing memory resources in the system among all computing nodes, improving the utilization rate of memory resources in the system, and further improving the read and write performance of the data system.

[0044] Please refer to the attached Figure 3 , which exemplarily shows the process of data writing in the data system, and the data writing process is described in detail below.

[0045] First, the operation of the computation layer is introduced.

[0046] The computing layer is used to write the data indicated by the write request into the memory table of the local memory, and transfer the data in the memory table of the local memory to the memory table of the memory layer.

[0047] The computing layer writes the data indicated by the write request into the memory table of the local memory in the form of a trans node. The computing layer can transfer the trans node in the memory table to the memory table of the memory layer through the RDMA unilateral operation. It is understandable that when writing the trans node in the memory table of the local memory, the computing layer can transfer the transnode to the memory layer in real time or in batches.

[0048] For example, the master node is used to generate a write-ahead log WAL (Write Ahead Log) based on the write request, synchronize the write-ahead log to each follower node and the persistent storage layer, and replay the write-ahead log to write data to the memory table of the local memory; the follower node is used to save the write-ahead log sent by the master node. In this example, only the master node replays the write-ahead log, and when the master node transfers the data in the memory table of the local memory to the memory table of the memory layer, each follower node can access the data in the memory table by accessing the shared memory layer.

[0049] If the remaining space in the local memory of the master node is small due to reasons such as a fast writing speed to the trans node, a large number of writings to the trans node, a slow transfer speed to the trans node to the memory layer, for example, less than a specific threshold, the computing layer (i.e., the master node) is also used to dump the memory table of the local memory to the local disk to form an ordered string table, and convert the data in the ordered string table in the local disk into the data format of the memory table, and then transfer it to the memory table of the memory layer.

[0050] Among them, the ordered string table formed by the master node dumping to the local disk is the ordered string microtable MicroSSTable. Micro SSTable is a sparse format, which is convenient for conversion with the memory table. The data in the data system has a parameter SCN to measure its order. The larger the SCN, the later the data is, and the smaller the SCN, the earlier the data is. The data range of Micro SSTable is represented by the start time Start SCN and the end time End SCN. In the process of parsing the transnode from Micro SSTable and transferring it to the memory layer, if the maximum SCN of the data in the memory table in the memory layer is greater than the End SCN of Micro SSTable, then all the data contained in Micro SSTable has been transferred to the memory layer, and Micro SSTable can be deleted to reclaim the storage space it occupies in the local disk.

[0051] Next, the operation of the memory layer is described.

[0052] The memory layer is used to allocate space for the data transferred by the computing layer when the computing layer transfers data to the memory layer, save the data transferred by the computing layer in the allocated space, and return the address of the allocated space to the computing layer.

[0053] Among them, the data transferred from the computing layer to the memory layer can be the trans node transferred by the computing layer from the memory table of its local memory, or the trans node parsed by the computing layer from the Micro SSTable of its local disk, both of which are transferred to the memory table of the memory layer.

[0054] For example, when the memory layer allocates space, it uses a data block Chunk as the allocated space and records the address information of the data block in the data block address table. Since the data block Chunk stores the data in the memory table of the memory layer, the data block Chunk is referenced by the memory table after being allocated.

[0055] For another example, when the memory layer is allocating space, if the capacity of the idle space does not meet the preset requirements, the idle space is increased in accordance with at least one of the following: dumping the memory table to the persistent storage layer; deleting part or all of the data in the read cache data. If the memory table has reached the dumping condition, the space can be freed up by dumping the memory table to the persistent storage layer; or part or all of the data in the read cache data can be deleted to free up space, preferably deleting some of the less popular data in the read cache data. Among them, the capacity of the idle space does not meet the preset requirements, which may mean that the idle space is less than a preset threshold, or the idle space is less than the space required for the data transferred by the computing layer.

[0056] When the memory table meets the freezing and dumping conditions, the memory layer can freeze the memory table and then dump it to the persistent storage layer to form an ordered string table SSTable in the persistent storage layer.

[0057] The ordered string table SSTable is divided into multiple levels, such as low-level Mini SSTable, medium-level Minor SSTable and high-level Major SSTable. Higher-level SSTable is formed by merging (Complication) of lower-level SSTable. For example, multiple Mini SSTables can be merged into a Minor SSTable, and multiple Minor SSTables can be merged into a Major SSTable.

[0058] Finally, the operation of the persistent storage layer is introduced.

[0059] If the persistent storage layer includes an object storage layer, the memory table is dumped to the object storage layer to form a MiniSSTable, and the Mini SSTable is merged upwards level by level to finally form a Major SSTable.

[0060] If the persistent storage layer includes a local storage layer and an object storage layer, the memory table is dumped to the local storage layer to form a Mini SSTable. The local storage layer can merge multiple Mini SSTables into Minor SSTable and upload the MinorSSTable to the object storage layer. The object storage layer will merge multiple Minor SSTables into Major SSTable.

[0061] It should be understood that the local storage layer may include multiple storage nodes. When the memory layer dumps the memory table to the local storage layer, the local storage layer will form an SSTable for the memory table on multiple storage nodes to ensure high availability of data.

[0062] It should be understood that the local storage layer merges multiple Mini SSTables into Minor SSTables and then uploads them to the object storage layer, which can reduce the number of writes to the object storage layer, alleviate the data writing pressure of the object storage layer, and ensure its performance.

[0063] Please refer to the attached Figure 4 , which exemplarily shows the process of data reading by the data system, and the data reading process is described in detail below.

[0064] First, the operation of the computation layer is introduced.

[0065] The computing layer is used to read the data indicated by the read request in the local memory and the local disk, and when the data indicated by the read request is successfully read, the data indicated by the read request is sent to the client; when the data indicated by the read request is not successfully read, the read request is forwarded to the memory layer, and the data returned by the memory layer is saved in the local memory.

[0066] Among them, the local memory of each computing node in the computing layer has a memory table, a fusion result buffer FuseRow Cache, a micro block cache Micro Block Cache, etc., and the local disk of each computing node has a MicroSSTable. Among them, Fuse Row Cache is used to store data fused by the computing node in response to a read request, that is, data previously returned to the client in response to the client's read request, and Micro Block Cache is used to store data loaded from the memory layer (in the read cache data) to the computing node. The space of Fuse Row Cache and Micro Block Cache is limited and is configured with an elimination mechanism.

[0067] For example, when the computing layer reads data, the master node reads the data indicated by the read request in its Fuse Row Cache. If the data is read successfully, the read data is directly returned to the client. If the data is not read successfully, the data indicated by the read request is read in the memory table, Micro Block, and Micro SSTable (if any). If the data is read successfully, the read data is fused with Fuse and returned to the client, and the fusion result is added to the Fuse Row Cache. If the data is not read successfully, it can be determined that there is no data indicated by the read request in the computing layer, so the read request is forwarded to the memory layer.

[0068] Next, the operation of the memory layer is described.

[0069] The memory layer is used to read the data indicated by the read request from the memory table and read cache data within the memory layer, and when the data indicated by the read request is successfully read, send the data indicated by the read request to the computing layer; when the data indicated by the read request is not successfully read, send a load request to the persistent storage layer, save the data returned by the persistent storage layer in the read cache data and send it to the computing layer, wherein the data indicated by the load request is the same as the data indicated by the read request.

[0070] Among them, the memory table in the memory layer is write cache data, and the read cache data in the memory layer is MicroCache. Micro Cache stores Micro Blocks loaded from the persistent storage layer to the memory layer. MicroBlocks are components of Macro Blocks in the persistent storage layer, that is, each Macro Block contains multiple MicroBlocks. When the memory layer loads data in the persistent storage layer into the read cache data, it loads it in units of Micro Block to avoid loading too much irrelevant data into the memory layer as much as possible.

[0071] For example, the memory layer reads the data indicated by the read request from its memory table and Micro Cache. If the data is read successfully, the data indicated by the read request (the Micro Block where it is located) is sent to the master node of the computing layer, so that the master node adds the data indicated by the read request to the Micro Block Cache and Fuse Row Cache, and returns it to the client; if the data is not read successfully, it can be determined that there is no data indicated by the read request in the memory layer, so a load request is sent to the persistent storage layer, so that the persistent storage layer returns the data indicated by the read request.

[0072] If the persistent storage layer only includes the object storage layer, the load request is directly sent to the object storage layer; if the persistent storage layer includes the local storage layer and the object storage layer, the load request is sent to the local storage layer.

[0073] When the memory layer saves the data returned by the persistent storage layer into the read cache data, space can be allocated for the data returned by the persistent storage layer, and the data returned by the persistent storage layer can be saved into the allocated space, so that the allocated space is added to the read cache data.

[0074] For example, when the memory layer allocates space, it uses a data block Chunk as the allocated space and records the address information of the data block in the data block address table. Since the data block Chunk stores the data in the Micro Cache of the memory layer, after the data block Chunk is allocated, it is referenced by the Micro Cache as a Micro Block.

[0075] For another example, when the memory layer is allocating space, if the capacity of the idle space does not meet the preset requirements, the idle space is increased in accordance with at least one of the following: dumping the memory table to the persistent storage layer; deleting part or all of the data in the read cache data. If the memory table has reached the dumping condition, the space can be freed up by dumping the memory table to the persistent storage layer; or part or all of the data in the read cache data can be deleted to free up space, preferably deleting some of the less popular data in the read cache data. Among them, the capacity of the idle space does not meet the preset requirements, which may mean that the idle space is less than a preset threshold, or the idle space is less than the space required for the data transferred by the computing layer.

[0076] Finally, the operation of the persistent storage layer is introduced.

[0077] The persistent storage layer is used to send the data indicated by the load request to the memory layer.

[0078] For example, the persistent storage layer may send the Micro Block containing the data indicated by the load request to the memory layer.

[0079] If the persistent storage layer only includes the object storage layer, the object storage layer sends the data indicated by the load request to the memory layer; if the persistent storage layer includes the local storage layer and the object storage layer, the local storage layer reads the data indicated by the load request in the local storage layer, and if the data is successfully read, the read data is directly sent to the memory layer; if the data is not successfully read, the data indicated by the load request in the object storage layer can be loaded locally and sent to the memory layer.

[0080] In some embodiments of the present specification, the computing layer is used to load part or all of the read cache data of the memory layer to the added computing node after the computing node is added; the computing layer is used to load part or all of the read cache data of the memory layer to the computing node after any computing node is restarted.

[0081] It can be seen that since the memory layer and the computing layer in this data system are decoupled and not bound, less data is loaded into the computing nodes of the computing layer. When the computing layer is expanded or the nodes are restarted, only some of the hotter data in the memory layer needs to be loaded into the newly added computing nodes or the restarted computing nodes for preheating. This improves the convenience of computing layer expansion, reduces the impact of computing node restarts in the computing layer on data services, and improves the speed of resuming services after computing nodes are restarted.

[0082] In some embodiments of the present specification, after any computing node of the computing layer is switched from a follower node to a master node, the computing node is used to load the write-ahead log in the persistent storage layer to the local computer, and replay the log after the write time in the write-ahead log to write the data after the write time to the memory layer, wherein the write time is used to represent the end time of the data written in the memory layer.

[0083] It can be seen that since the follower nodes in the computing layer of the data system only store the pre-write logs but do not replay the pre-write logs, and the master node will write the data to the memory layer synchronously or asynchronously after replaying the pre-write logs, after the follower node switches to the master node, it only needs to replay the part of the pre-write log that was not replayed before the original master node lost its master node identity, and then it can run according to the master node. The new master node can determine the starting time (such as the starting SCN) of replaying the pre-write log by the end time (such as the end SCN) of the data written in the memory layer, that is, the new master node replays the pre-write log with the end SCN of the data written in the memory layer as the starting SCN, so that the data system can ensure data consistency and integrity when switching the master node.

[0084] In some embodiments of the present specification, the memory layer is used to determine the data range of any memory node after the memory node goes offline, load the write-ahead log in the persistent storage layer to the memory layer, and replay the portion of the write-ahead log corresponding to the data range to load the data within the data range to other memory nodes.

[0085] The offline memory node may be offline due to a crash or user operation.

[0086] It can be seen that since each memory node in the memory layer of the data system stores write cache data or read cache data, and the data block address table used to record the addresses of write cache data and read cache data in the memory layer is stored in each memory node, after a memory node goes offline, the data range of the memory node can be determined through the data block address tables in other memory nodes, that is, which data in the write cache data and which data in the read cache data are in the memory node, and then the pre-write log in the persistent storage layer (such as the object storage layer) is loaded into the memory layer and the corresponding log is played back according to the data range of the memory node, and the data loaded in the memory node is loaded into other memory nodes, thereby restoring the data range of the memory layer before the memory node goes offline.

[0087] Moreover, the memory layer has the ability to parse and replay the write-ahead logs. The memory layer is distributed, and the replay task can be divided into parallel tasks when replaying the write-ahead logs, thereby improving the efficiency of replaying logs.

[0088] In addition, the memory layer is used to transfer the write cache data and the read cache data in the memory node to other memory nodes before deleting the memory node when shrinking, that is, when any memory node is deleted from the memory layer.

[0089] From the above embodiments, it can be seen that the computing resources and memory resources of the data system are decoupled from each other and are not bound. The computing resources can be independently expanded, reduced, replaced, sold, etc., and the memory resources can also be independently expanded, reduced, replaced, sold, etc., and the failure of memory resources does not affect the computing resources, and the failure of computing resources does not affect the memory resources. On the whole, memory resources are pooled and shared among different computing nodes, and the utilization rate is high. This can provide a more flexible computing memory combination method, such as selecting computing resources with a smaller number of cores and combining them with a larger memory to meet personalized usage requirements.

[0090] Figure 5 This is a schematic diagram of a device provided by an exemplary embodiment. The device can be used to run the function of a computing node or a memory node in the data system. Please refer to Figure 5At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other tasks. One or more embodiments of this specification may be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

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

[0092] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0093] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0094] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0095] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

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

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

[0098] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

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

[0100] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A data system, comprising: A computing layer, including a plurality of computing nodes, each computing node is in communication connection with the memory layer, and the computing layer is used to write data to the memory layer based on a write request of a client or read data from the memory layer based on a read request of a client; A memory layer, including a plurality of memory nodes, each memory node being in communication connection with a persistent storage layer, the memory layer being used to receive data written by the computing layer, and to dump the data written by the computing layer to the persistent storage layer, and to load corresponding data in the persistent storage layer in response to a read request of the computing layer, and to send the corresponding data to the computing layer; The persistent storage layer is used to receive and save the data dumped by the memory layer, and to respond to the loading request of the memory layer and send the corresponding data to the memory layer.

2. According to the data system of claim 1, the computing layer is used to write the data indicated by the write request into the memory table of the local memory, and transfer the data in the memory table of the local memory to the memory table of the memory layer.

3. According to the data system of claim 2, the computing layer is also used to dump the memory table of the local memory to the local disk to form an ordered string table, and convert the data in the ordered string table in the local disk into the data format of the memory table, and then transfer it to the memory table of the memory layer.

4. The data system according to claim 2, wherein the plurality of computing nodes of the computing layer comprises a master node and at least one follower node; The master node is used to generate a write-ahead log based on the write request, synchronize the write-ahead log to each follower node and the persistent storage layer, and replay the write-ahead log to write data to a memory table in a local memory; The follower node is used to save the write-ahead log sent by the master node.

5. According to the data system of claim 2, the memory layer is used to allocate space for the data transferred by the computing layer when the computing layer transfers data to the memory layer, save the data transferred by the computing layer in the allocated space, and return the address of the allocated space to the computing layer.

6. According to the data system of claim 1, the computing layer is used to read the data indicated by the read request in the local memory and the local disk, send the data indicated by the read request to the client when the data indicated by the read request is successfully read, forward the read request to the memory layer when the data indicated by the read request is not successfully read, and save the data returned by the memory layer in the local memory; The memory layer is used to read the data indicated by the read request from the memory table and read cache data in the memory layer, send the data indicated by the read request to the computing layer when the data indicated by the read request is successfully read, send a load request to the persistent storage layer when the data indicated by the read request is not successfully read, save the data returned by the persistent storage layer into the read cache data and send it to the computing layer, wherein, The data indicated by the load request is the same as the data indicated by the read request; The persistent storage layer is used to send the data indicated by the load request to the memory layer.

7. According to the data system of claim 6, when the memory layer is used to save the data returned by the persistent storage layer into the read cache data, it allocates space for the data returned by the persistent storage layer and saves the data returned by the persistent storage layer into the allocated space so that the allocated space is added to the read cache data.

8. According to the data system of claim 5 or 7, when allocating space, the memory layer uses a data block as the allocated space and records the address information of the data block in the data block address table.

9. The data system according to claim 5 or 7, when the memory layer allocates space, if the capacity of the idle space does not meet the preset requirement, the idle space is increased according to at least one of the following: Dumping the memory table to the persistent storage layer; Delete some or all of the data in the read cache.

10. The data system according to claim 1, wherein the computing layer is used to load part or all of the read cache data of the memory layer to the added computing node after the computing node is added; The computing layer is used to load part or all of the read cache data of the memory layer to any computing node after the computing node is restarted.

11. According to the data system of claim 1, after any computing node of the computing layer switches from a follower node to a master node, the computing node is used to load the write-ahead log in the persistent storage layer to the local computer and replay the log after the write time in the write-ahead log to write the data after the write time to the memory layer, wherein: The write time is used to represent the end time of the data written into the memory layer.

12. According to the data system of claim 1, the memory layer is used to determine the data range of any memory node after the memory node goes offline, load the write-ahead log in the persistent storage layer to the memory layer, and replay the part of the write-ahead log corresponding to the data range to load the data within the data range to other memory nodes.

13. According to the data system of claim 1, each computing node of the computing layer is integrated into the same device with a memory node of the memory layer; or, each memory node of the memory layer is a device independent of all computing nodes in the computing layer.

14. The data system according to claim 1, wherein the persistent storage layer comprises a local storage layer and / or an object storage layer.

Citation Information

Patent Citations

  • Computing storage separation system and data access method thereof, medium and electronic equipment

    CN113220693A

  • Data storage system, data storage method, readable medium, and electronic equipment

    CN113901024A

  • Distributed cache and data storage consistency processing system and method

    CN116383227A

  • Cloud native space database management system, method and equipment and storage medium

    CN118760785A

  • Remote one-sided persistent writes

    US20190102087A1