Operation method and device of hybrid multi-volume structure key value storage system in cloud environment
By adopting a hybrid multi-volume structure key-value storage system in a cloud environment, load balancing between cloud storage volumes is achieved, the problem of load imbalance in the existing technology is solved, and access efficiency and performance are improved.
Patent Information
- Application Number
- CN202410819606.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-06-24
AI Technical Summary
In a multi-cloud storage volume scenario, the existing LSM-Tree key-value storage system cannot fully utilize cloud storage performance due to load imbalance among cloud storage volumes, affecting access efficiency.
Adopt a hybrid multi-volume structure key-value storage system, including a memory layer, a persistent cache layer and a data layer. By writing data in parallel to multiple persistent write cache volumes, and performing compression and merging operations, it combines the dynamics of persistent read cache volumes and data volumes. Resource adjustment to achieve load balancing among cloud storage volumes.
It improves data access efficiency, makes full use of the parallelism and cost-effectiveness of multiple cloud storage volumes, balances the load of each data volume, and improves the overall performance of the system.
Smart Images

Figure CN118838540A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to information storage, and more specifically, relates to an operation method and device of a hybrid multi-volume structure key-value storage system in a cloud environment. Background Art
[0002] With the development of cloud technology, cloud service providers provide data storage and management services by integrating large-scale storage, computing, network and other resources in data centers, and ensure data reliability and performance through technologies such as erasure coding and load balancing. Compared with traditional local storage such as non-volatile memory (NVM), solid state disk (SSD), and hard disk drive (HDD), cloud storage provides high scalability, high reliability, fast recovery, high performance, and pay-as-you-go storage mode, which well meets the storage needs of various enterprises and also provides more efficient storage solutions for some traditional applications. Cloud storage can provide high storage capacity for key-value storage, while ensuring data reliability and good scalability, which has strongly promoted the development of key-value storage systems in cloud storage.
[0003] According to the billing rules of cloud storage volumes, using multiple cloud storage volumes is more cost-effective than using a single cloud storage volume. However, the latency of cloud storage volumes varies significantly under different load pressures. In the scenario of multiple cloud storage volumes, the existing LSM-Tree key-value storage system cannot fully utilize the cloud storage performance due to the unbalanced load between the cloud storage volumes, which affects the access efficiency. Summary of the invention
[0004] In response to the above defects or improvement needs of the prior art, the present invention provides an operation method and device for a hybrid multi-volume structure key-value storage system in a cloud environment, the purpose of which is to achieve load balancing between cloud storage volumes and improve access efficiency.
[0005] To achieve the above-mentioned purpose, according to one aspect of the present invention, there is provided an operation method of a hybrid multi-volume structure key-value storage system in a cloud environment, wherein the system comprises a memory layer, a persistent cache layer and a data layer, the persistent cache layer comprises a plurality of persistent write cache volumes, the data layer has N data volumes, namely, data volume 0 to data volume N-1, where N≥2, the persistent write cache volume and the data volume are both cloud storage volumes, the access performance of the cloud storage volume in the persistent cache layer is better than that of the cloud storage volume in the data layer, and the capacity of the cloud storage volume in the persistent cache layer is smaller than that of the cloud storage volume in the data layer; the operation method comprises writing data to the system when a write instruction is received, and the process of writing data comprises:
[0006] Write the key-value data {key, value} into the memory table MemTable of the memory layer;
[0007] The key-value data in different memory tables MemTable are flushed to different persistent write cache volumes in parallel to form SSTable files of the L0 layer, where the key of the key-value data is stored in the SSTable files;
[0008] Perform internal compression and merging and inter-layer compression and merging. The internal compression and merging is to compress and merge multiple SSTable files in each of the persistent write cache volumes, and the newly generated SSTable files are written back to the persistent write cache volume. The inter-layer compression and merging is to compress and merge the SSTable files of the Lk layer with the SSTable files of the L(k+1) layer, and write the SSTable files of the L(k+1) layer newly generated by the compression and merging into the selected data volume, where k is the layer index, k=0,1,2,…,n, n is the total number of layers, and L1~Ln layers are in each data volume;
[0009] Among them, after the upper SSTable file is compressed and merged with the lower SSTable file, the data volume to which the newly generated SSTable file of the lower layer will be written is selected according to the following method:
[0010] The key range from the global minimum key to the maximum key recorded in the system is evenly divided into m intervals, from interval 0 to interval m-1, where m is a preset positive integer;
[0011] Determine the index idx of the interval where the minimum key in the newly generated SSTable file is located;
[0012] The index of the data volume to which the newly generated SSTable file is to be written is calculated as Index = (idx + level) % N, where level is the index of the layer where the newly generated SSTable file is located, Index is the index of the data volume, and % is a modulo operation.
[0013] In some embodiments, the persistent cache layer further includes a persistent read cache volume, the persistent read cache volume is a cloud storage volume, the persistent read cache volume is divided into N independent persistent block caches Bcaches, the N Bcaches correspond to the N data volumes one by one, the operation method further includes reading data from the system when a read instruction is received, and the process of reading data includes:
[0014] Search from the current Memtable of the system; if it does not hit in the Memtable, search in all L0 SSTable files in the persistent write cache; if it still does not hit, search in the persistent read cache;
[0015] The process of reading data from the persistent read cache includes:
[0016] Locate the corresponding Bcache based on the data volume where the target data block is located, and determine whether the located Bcache has the target data block and whether the located Bcache has reached its IOPS limit:
[0017] If the located Bcache has the target data block and its IOPS limit has not been reached, obtain the access token of the located Bcache and read the target data block from the located Bcache;
[0018] If the located Bcache does not have the target data block or has currently reached its IOPS limit, the target data block is read from the located data volume and the read target data block is inserted into the corresponding Bcache.
[0019] In some embodiments, each Bcache corresponds to a hash table, and the hash table is used to index each data block in the Bcache;
[0020] Insert the target data block read from the located data volume into the corresponding Bcache, including:
[0021] Locate the corresponding Bcache based on the data volume where the target data block is located;
[0022] Determine whether the target data block exists in Bcache based on the hash table corresponding to Bcache:
[0023] If it exists, the Bcache is not inserted;
[0024] If it does not exist, the target data block is first inserted into the blocking queue of the memory layer;
[0025] The data blocks in the blocking queue are taken out sequentially through the background thread. Each time a data block is taken out, an application is made to obtain the access token of the Bcache to be written. After the access token is obtained, the taken data block is inserted into the cache file of Bcache, and the index of the cache file where the inserted data block is located and the offset of the data block inserted into the cache file are recorded in the hash table. One cache file corresponds to one SSTable file. After each cache file is written, the file pointer of the corresponding cache file is inserted into the head of the corresponding Bcache's doubly linked list. If Bcache is full when the data block is inserted, the cache space at the tail of the doubly linked list is released.
[0026] In some embodiments, a token bucket algorithm is used to manage the access token of each Bcache in the persistent read cache volume:
[0027] A corresponding limiter is set for each Bcache, and each limiter stores a token bucket corresponding to the Bcache. The limiter updates the number of remaining access tokens in the token bucket corresponding to the Bcache to its IOPS upper limit at the initial moment of each access cycle. In the current access cycle, when access to the Bcache is required, an access token is first applied to the limiter corresponding to the Bcache. If there are remaining tokens in the token bucket, an access token is taken out of the token bucket and the corresponding Bcache is accessed. The number of remaining tokens in the token bucket is reduced by 1. If there are no remaining tokens in the token bucket, the access token cannot be obtained in the current access cycle.
[0028] In some embodiments, the total resources occupied by all Bcaches in the persistent read cache volume are fixed, and the operation method further includes periodically adjusting the resources allocated to each Bcach in the persistent read cache volume, wherein the resources include the capacity size and the IOPS upper limit size:
[0029] Scenario 1: If the difference in heat between each data volume and other data volumes does not exceed the difference threshold, the resources currently occupied by each Bcache will not be modified. The heat is the average number of accesses per unit time within a set period.
[0030] Scenario 2: If the difference in popularity between two data volumes exceeds the difference threshold, and the Bcache corresponding to the data volume with the highest popularity has not currently reached its IOPS limit, the capacity of the Bcache corresponding to the data volume with the highest popularity will be increased, and the capacity of the remaining Bcache will be adjusted according to the access popularity of the corresponding data volumes. The higher the access popularity, the larger the Bcache capacity.
[0031] Scenario 3: If the difference in popularity between two data volumes exceeds the gap threshold, and the Bcache corresponding to the data volume with the highest popularity has currently reached its IOPS limit, the IOPS limit of the Bcache corresponding to the data volume with the highest popularity will be increased, and the IOPS limits of the remaining Bcaches will be adjusted according to the access popularity of the corresponding data volumes. The higher the access popularity, the greater the IOPS limit of the Bcache.
[0032] In some embodiments, in scenario three:
[0033] The IOPS limit of any Bcache except the Bcache corresponding to the most popular data volume is updated to N other_new :
[0034] N other_new =max(N other_old -a*(W max -W i ),0)
[0035] In the formula, Nother_new The updated IOPS limit of Bcache, N other_old is the IOPS upper limit before Bcache update, a>0 is the preset proportional coefficient, W max is the upper limit of the heat of the corresponding data volume, W i is the current popularity of the corresponding data volume i;
[0036] The IOPS limit of Bcache corresponding to the most popular data volume is updated to N new :
[0037] N new =N old +∑(N other_old -N other_new)
[0038] Where N new The updated IOPS limit of Bcache, N old This is the IOPS limit before Bcache is updated.
[0039] In some embodiments, the operating method further includes:
[0040] Monitor the heat of the persistent write cache volume, which is the average number of accesses per unit time within a set period:
[0041] When the heat of the persistent write cache volume does not exceed the set threshold, there is a data volume in the data layer whose heat difference with its data volume IOPS upper limit is less than the preset value, and the Bcache corresponding to the data volume on the persistent read cache has currently reached the IOPS upper limit, part of the space of the corresponding persistent write cache volume is used to store SSTable files, and the remaining space is used to establish a Bcache to expand the capacity of the persistent read cache volume; when the heat of the persistent write cache volume exceeds the set threshold, the Bcache in the persistent write cache volume is reclaimed for storing SSTable files.
[0042] In some embodiments, the persistent write cache volume and the persistent read cache volume are both burst cloud storage volumes, and the operation method further includes: calculating the points of each burst cloud storage volume; when the points of any burst cloud storage volume exceed a preset level, creating a new burst cloud storage volume to replace the burst cloud storage volume whose points exceed the preset level;
[0043] When replacing a persistent read cache volume, create a new cloud storage volume, traverse the Bcache in the persistent read cache volume, and perform the following process on each Bcache in the persistent read cache in turn:
[0044] Pause the insertion operation on the current Bcache;
[0045] Flush the cache data in the current memory layer to be inserted into the current Bcache into the current Bcache;
[0046] Copy all data in the current Bcache to the new cloud storage volume;
[0047] Change the current Bcache search path and insertion path to the path where the new cloud storage volume is located;
[0048] Resume the current Bcache insert operation.
[0049] After traversing all Bcaches in the persistent read cache and executing the above process, the original persistent read cache volume is deleted;
[0050] When replacing a persistent write cache volume, execute:
[0051] Create a new cloud storage volume and replace its path with the path of the original persistent write cache volume to ensure that the SSTable files generated by flushing during the data migration process are written to the newly created cloud storage volume;
[0052] Determine whether there is an SSTable file in the original persistent write cache volume. If there is an SSTable file, compress and merge the SSTable files in the original persistent write cache volume and write them to the data volume until all SSTable files are flushed to the data volume.
[0053] Determine whether there is Bcache in the original persistent write cache volume that extends the persistent read cache. If so, copy the data in Bcache in the persistent write cache to the newly created cloud storage volume according to the process of replacing the persistent read cache volume.
[0054] Delete the original persistent write cache volume.
[0055] In some embodiments, the calculation formula for calculating the credits of each cloud storage volume in the persistent cache layer is:
[0056]
[0057] Where St is the credit of the corresponding cloud storage volume in the persistent cache layer at time t, Smax is the maximum credit of the corresponding cloud storage volume, and is also its initial credit, S t-1 is the credit number of the corresponding cloud storage volume at time t-1, C is the capacity of the corresponding cloud storage volume, and I (t-1,t] It is the number of I / Os of the corresponding cloud storage volume from time t-1 to time t.
[0058] According to one aspect of the present invention, there is provided an operating device for a hybrid multi-volume structure key-value storage system in a cloud environment, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of any of the methods described above when executing the computer program.
[0059] In general, compared with the prior art, the above technical solutions conceived by the present invention mainly have the following beneficial effects:
[0060] 1. The present invention proposes a key-value storage system with a hybrid multi-storage volume structure in a cloud environment, which is composed of a memory layer, a persistent cache layer and a data layer. The persistent write cache volume and the data volume are both cloud storage volumes. The access performance of the cloud storage volume in the persistent cache layer is better than that of the cloud storage volume in the data layer, and the capacity of the cloud storage volume in the persistent cache layer is smaller than that of the cloud storage volume in the data layer. By using multiple cloud storage volumes of different types, the characteristics of different cloud storage volumes and the cost-effectiveness of multiple cloud storage volumes are effectively utilized, so that the data access efficiency of the storage system is greatly improved.
[0061] 2. The operation method proposed in the present invention is used to write data. On the one hand, when refreshing the MemTable, it is written in parallel to multiple persistent write cache volumes, which makes full use of the parallelism of multiple cloud storage volumes and avoids the load being concentrated on a certain persistent write cache volume. It ensures that the number of SSTable files on each persistent write cache volume is consistent, which is beneficial to the load balancing of the read load on the persistent write cache volume; on the other hand, the selection of SSTable files participating in the compression and merging process and the selection of the write path after generating a new SSTable file are modified, so that different layers of SSTable files within the same key range on the data volume can be distributed in different data volumes in turn, so that the multiple read operations caused by read amplification are dispersed as much as possible in different data volumes. At the same time, SSTable files on cloud storage volumes with low load intensity are given priority, which further balances the load on each data volume.
[0062] 3. Furthermore, by allocating an independent persistent block cache Bcache to each data volume to cache the hot data blocks of the SSTable file on the corresponding data volume, the low read and write latency of the persistent read cache volume and the IOPS it provides are fully utilized to improve the system read performance.
[0063] 4. Furthermore, by dynamically adjusting the corresponding Bcache resources according to the different heat of the data volumes, the load on the hot data volumes can be transferred more to the persistent read cache volume, while the low-heat data volumes will undertake more read and write requests, thereby achieving load balancing on each data volume. In addition, by borrowing part of the space of the low-heat persistent write cache volume to achieve dynamic expansion and contraction of the persistent read cache, resource utilization is further improved.
[0064] 5. Furthermore, a credit monitoring and cache volume replacement mechanism is proposed to prevent the sudden increase in the read and write latency of the persistent read and write cache volume from affecting the overall performance after the credits are exhausted. The credits of the cache volume are monitored in real time, and a new cloud storage volume is automatically created to replace the old cloud storage volume when the credits are low. During the replacement process, different replacement strategies are adopted for cache volumes with different purposes and the copy data rate is limited, effectively reducing the impact on performance during the cache volume replacement process. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a structural diagram of a hybrid multi-volume structure key-value storage system in a cloud environment in one embodiment of the present invention;
[0066] Figure 2 is a schematic diagram of data flush compression during writing in one embodiment of the present invention;
[0067] Figure 3 is a schematic diagram of internal compression merging in one embodiment of the present invention;
[0068] Figure 4 is a schematic diagram of inter-layer compression merging in one embodiment of the present invention;
[0069] Figure 5 is a schematic diagram of dividing a persistent read cache module into multiple Bcaches in one embodiment of the present invention;
[0070] Figure 6 is a schematic diagram of the structure of a Bcache in one embodiment of the present invention;
[0071] FIG. 7( a ) is a flow chart of steps for searching a data block in a persistent read cache in one embodiment of the present invention;
[0072] FIG. 7( b ) is a flow chart of steps for inserting a data block into a persistent read cache in one embodiment of the present invention;
[0073] Figure 8 is a schematic diagram of a token bucket algorithm in one embodiment of the present invention;
[0074] Fig. 9 is a resource allocation flow chart in one embodiment of the present invention;
[0075] Fig.10 is a flow chart of replacing a persistent read cache volume in one embodiment of the present invention;
[0076] Fig.11 The present invention is a flowchart of replacing a persistent write cache volume in one embodiment of the present invention. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0078] like Figure 1 The figure shows a schematic diagram of the structure of a hybrid multi-volume key-value storage system in a cloud environment in an embodiment of the present invention. The key-value storage system uses the LSM-Tree structure as the storage engine. This embodiment is implemented based on RocksDB and is divided into a memory layer, a persistent cache layer, and a data layer.
[0079] The memory layer is responsible for storing MemTable, immutable MemTable, block cache, and related statistical scheduling information. Specifically, a statistical scheduling module can be run in the memory layer to record the access status of each cloud storage volume, including the number of read and write accesses, the size of each read and write request, and the last update time. This data can be used to subsequently calculate the load intensity, popularity, and points of each cloud storage volume.
[0080] The persistent cache layer uses multiple burst storage volumes with smaller capacity and higher performance. Specifically, the product that can be used is Amazon EBS gp2 cloud storage volume. For example, two burst storage volumes are used as persistent write cache volumes. The MemTable in the memory is written to the two persistent write cache volumes in parallel after the L0 layer SSTable file is generated. Furthermore, one burst storage volume can be used as a persistent read cache volume to cache hot data in the data volume.
[0081] The data layer uses N cloud storage volumes with larger capacity, lower performance and lower cost as data volumes to store large amounts of data. Specifically, the product that can be used is Amazon EBS gp3 cloud storage volume. The SSTable files in the persistent write cache are asynchronously written to the data volume through compression and merging operations.
[0082] In addition, to avoid the impact of writing WAL logs on performance while ensuring data reliability, set up a small-capacity high-performance cloud storage volume to store WAL logs. Specifically, you can use Amazon EBS io2 cloud storage volume.
[0083] With respect to the hybrid multi-volume structure key-value storage system in the above cloud environment, the present invention proposes an operation method thereof to optimize storage performance.
[0084] Example 1
[0085] This embodiment proposes an operation method of a hybrid multi-volume structure key-value storage system in a cloud environment, including writing data to the system when a write instruction is received.
[0086] like Figure 2 FIG. 1 is a schematic diagram of data flush compression during writing in an embodiment of the present invention.
[0087] The process of writing data includes:
[0088] Write the key-value data {key, value} into the memory table MemTable of the memory layer;
[0089] The key-value data in different memory tables MemTable are flushed to different persistent write cache volumes in parallel to form SSTable files at the L0 layer. The SSTable files store the key of the key-value data.
[0090] Perform internal compression and merging and inter-layer compression and merging. The internal compression and merging is to compress and merge multiple SSTable files in each persistent write cache volume, and the newly generated SSTable files are written back to the persistent write cache volume. The inter-layer compression and merging is to compress and merge the SSTable files of the Lk layer with the SSTable files of the L(k+1) layer, and write the SSTable files of the L(k+1) layer newly generated by the compression and merging into the selected data volume, where k is the layer index, k=0,1,2,…,n, n is the total number of layers, and L1~Ln layers are in each data volume;
[0091] Among them, after the upper SSTable file is compressed and merged with the lower SSTable file, the data volume to which the newly generated SSTable file of the lower layer will be written is selected according to the following method:
[0092] The key range from the global minimum key to the maximum key recorded in the system is evenly divided into m intervals, from interval 0 to interval m-1, where m is a preset positive integer;
[0093] Determine the index idx of the interval where the minimum key in the newly generated SSTable file is located;
[0094] The index of the data volume to which the newly generated SSTable file is to be written is calculated as Index = (idx + level) % N, where level is the index of the layer where the newly generated SSTable file is located, Index is the index of the data volume, and % is a modulo operation.
[0095] Specifically, when performing a write operation, the operation is first recorded in the WAL log, and then the key-value data is written to the MemTable in the memory before returning.
[0096] Specifically, you can run the parallel flush module to flush the data in the memory layer to the persistent write cache layer. Generally speaking, when the MemTable is full of data, it will automatically be converted to an immutable MemTable and wait for data to be flushed.
[0097] Taking two persistent write cache volumes as an example, when the number of immutable MemTables is greater than 1, the parallel flush module takes out two immutable MemTables that can be flushed, passes the two immutable MemTables into the flush queue, and allocates two threads from the flush thread pool to execute the flush operations of the two immutable MemTables respectively, and write them into two different persistent write cache volumes.
[0098] In specific operations, you can run the internal compression and merging submodule to perform internal compression and merging, such as Figure 3 The figure shows a schematic diagram of internal compression and merging in an embodiment of the present invention. The internal compression and merging submodule periodically queries the average I / O bandwidth of the current persistent write cache volume recorded in the memory layer statistical scheduling module in the past period of time (such as within 10 seconds). If the average bandwidth of the current persistent write cache volume is less than the preset value (such as 60MB), it means that the load intensity is low, triggering the compression operation inside the persistent write cache: first traverse the SSTable files of the L0 layer, and add the SSTable files that have not been compressed and are not currently participating in the compression and merging operation to the memory array, and then determine whether the number of array elements is greater than or equal to the preset value (for example, 8). If the number of array elements is too small, no compression and merging operation is performed. Otherwise, the array is split into two sub-arrays, and a thread is assigned to each sub-array to perform the compression and merging operation of the SSTable files in the sub-array, and the new SSTable files generated after the compression and merging are written into the corresponding persistent write cache.
[0099] In specific operations, you can run the inter-layer compression and merging submodule to perform inter-layer compression and merging, such as Figure 4 The figure shows a schematic diagram of inter-layer compression and merging in an embodiment of the present invention. The inter-layer compression and merging submodule will count the current bandwidth of each data volume, and select the SSTable files on the data volume with the lower current bandwidth to participate in the inter-layer compression and merging operation. When generating a new SSTable file, the data volume to be written is selected according to the key range and the number of SSTable file layers. The main process is as follows:
[0100] The minimum and maximum keys stored in the real-time statistics system are evenly divided into multiple intervals according to the stored global maximum key range. Each interval is a specified key range. For example, if it is divided into 1000 arrays, the key value range of array 1 is 1 to 5, the key value range of array 2 is 6 to 10, the key value range of array 3 is 11 to 15, and so on.
[0101] The newly generated SSTable file determines the interval index idx based on its minimum key, and calculates the data volume index to be written Index = (idx+level)%N based on the interval index and the level of the SSTable file.
[0102] Take N=3 as an example:
[0103] When the SSTable file on L0 is compressed and merged into the L1 layer, the level of the newly generated SSTable file is 1.
[0104] If the minimum key of the SSTable is in interval 10, idx=10, Index=2, write to the L1 layer of data volume 2;
[0105] If the minimum key of the SSTable is in interval 11, idx=11, Index=0, write to the L1 layer of data volume 0;
[0106] If the minimum key of the SSTable is in interval 12, idx=12, Index=1, write to the L1 layer of data volume 1;
[0107] In general, by grouping the key values and distributing the written data volumes through the above calculation method, the amount of SSTable files written to each data volume can be made basically the same, thereby achieving load balancing of the data volumes.
[0108] Example 2
[0109] like Figure 5 The figure shows a schematic diagram of a persistent read cache module in an embodiment of the present invention being divided into multiple Bcaches. The persistent read cache volume is divided into N independent persistent block caches Bcaches, and the N Bcaches correspond to the N data volumes one by one. Taking N=3 as an example, a gp2 burst storage volume is used as a persistent read cache module to cache hot data on three data volumes, and an independent persistent block cache (Block Persistent Cache, Bcache) is allocated to each data volume to cache the hot data blocks of the SSTable files on its corresponding data volume.
[0110] This embodiment also proposes an operation method of a hybrid multi-volume structure key-value storage system in a cloud environment. The operation method also includes reading data from the system when a read instruction is received. The process of reading data includes:
[0111] Search from the system's current Memtable; if it does not hit in the Memtable, search in all L0 SSTable files in the persistent write cache; if it still does not hit, search in the persistent read cache.
[0112] The process of reading data from the persistent read cache includes:
[0113] Locate the corresponding Bcache based on the data volume where the target data block is located, and determine whether the located Bcache has the target data block and whether the located Bcache has reached its IOPS limit:
[0114] If the located Bcache has the target data block and its IOPS limit has not been reached, obtain the access token of the located Bcache and read the target data block from the located Bcache;
[0115] If the located Bcache does not have the target data block or has currently reached its IOPS limit, the target data block is read from the located data volume and the read target data block is inserted into the corresponding Bcache.
[0116] like Figure 6 The diagram shows a schematic diagram of the structure of a Bcache in one embodiment of the present invention. Bcache is used to manage hot data blocks of SSTable files on the corresponding data volume. Multiple data blocks in Bcache are organized into a cache file, and a cache file is an SSTable file. A bidirectional linked list and hash table of Bcache are established and maintained in memory, which is responsible for indexing cache data. At the same time, a blocking queue is maintained to store data to be inserted into Bcache. Bcache is managed based on the Least Recently Used (LRU) algorithm with cache files as the granularity.
[0117] Specifically, a limiter can be set for each Bcache, and each limiter stores the token bucket corresponding to the Bcache. The limiter updates the number of remaining access tokens in the token bucket corresponding to the Bcache at the initial moment of each access cycle (for example, 1s) to its IOPS upper limit. The IOPS upper limit is the maximum number of read and write operations. The sum of the IOPS upper limits of all Bcaches in the persistent read cache volume is the IOPS upper limit of the persistent read cache volume. The IOPS upper limit of the persistent read cache volume is fixed, and the IOPS upper limit of each Bcache can be allocated through the set allocation strategy. In the current access cycle, when access to Bcache is required, first apply for an access token from the limiter corresponding to the Bcache. If there are remaining tokens in the token bucket, take an access token from the token bucket and access the corresponding Bcache. The number of remaining tokens in the token bucket is reduced by 1. If there are no remaining tokens in the token bucket, the access token cannot be obtained in the current access cycle.
[0118] As shown in FIG. 7( a ), it is a flowchart of the steps of searching for data blocks in a persistent read cache in an embodiment of the present invention, including: locating the Bcache to be searched according to the data volume where the data block to be searched is located, and then searching the hash table of the Bcache to see whether the data block has been cached. If it does not hit, it means that the current data block has not been cached and returns directly; if it has been cached, it is necessary to first obtain a token from the limiter, and if the token is successfully obtained, the data block in the corresponding cache file is read, and if the token is not successfully obtained, it returns directly, in order to avoid a large number of read requests blocking the persistent read cache and causing a sharp increase in latency. Finally, in order to maintain the LRU algorithm and facilitate subsequent elimination, the pointer of the read cache file needs to be moved to the head of the bidirectional linked list.
[0119] In one embodiment, inserting the target data block read from the located data volume into the corresponding Bcache includes:
[0120] Locate the corresponding Bcache based on the data volume where the target data block is located;
[0121] Based on the hash table corresponding to Bcache, determine whether the target data block exists in Bcache:
[0122] If it exists, it will not be inserted into Bcache;
[0123] If it does not exist, the target data block is first inserted into the blocking queue of the memory layer;
[0124] The data blocks in the blocking queue are taken out sequentially through the background thread. Each time a data block is taken out, an application is made to obtain the access token of the Bcache to be written. After the access token is obtained, the taken data block is inserted into the cache file of Bcache, and the index of the cache file where the inserted data block is located and the offset of the data block inserted into the cache file are recorded in the hash table. One cache file corresponds to one SSTable file. After each cache file is written, the file pointer of the corresponding cache file is inserted into the head of the corresponding Bcache's doubly linked list. If Bcache is full when the data block is inserted, the cache space at the tail of the doubly linked list is released.
[0125] As shown in FIG7(b), it is a flowchart of the steps of inserting a data block into a persistent read cache in an embodiment of the present invention, including: first, when inserting a data block, it is necessary to locate the Bcache to be inserted according to the data volume where the data block is located, and then search in the hash table of the Bcache. If it does not hit, it means that the currently inserted data block has not been cached in the Bcache, and the data block to be inserted is inserted into the blocking queue; if it hits, it means that the currently inserted data block has been cached in the Bcache, so it returns directly. The background thread will continue to take out the data block to be inserted from the blocking queue and store it in the write cache. After taking out the data block to be inserted, it is first necessary to obtain the limiter token, and then write the data block to be inserted into the cache file, and record the cache file index where the data block is located and the offset of the data block in the cache file in the hash table. Finally, when the cache file is full, the file pointer of the cache file will be inserted into the head of the bidirectional linked list.
[0126] In one embodiment, the limiter on Bcache specifically uses a token bucket algorithm to limit the flow, such as Figure 8 The diagram is a schematic diagram of a token bucket algorithm in an embodiment of the present invention. Since a read operation can complete the read process by reading data on the data volume if a token cannot be obtained, and a write operation must obtain a token to complete the write operation, the limiter needs to adopt different processes for read and write operations.
[0127] The limiting process of the limiter for read operations is as follows: When a read operation attempts to obtain a token, first determine whether the current time has exceeded one second since the last token replenishment. If it has exceeded one second, first replenish the number of tokens in the token bucket to the upper limit, then atomically reduce the number of remaining tokens in the token bucket by one, and finally determine whether the current number of remaining tokens is less than zero. If it is less than zero, it means that there are no remaining tokens at present, and the remaining token number is increased by one and false is returned, indicating that the token has not been successfully obtained; if the remaining token number is greater than or equal to zero, it means that the token has been successfully obtained, and true is returned.
[0128] The overall flow control process of the limiter for write operations is similar to that for read operations, except that the write operation must successfully obtain the token when obtaining the token. Therefore, when the token acquisition fails, it is necessary to wait until the token is replenished to obtain the token again.
[0129] Example 3
[0130] This embodiment also proposes an operation method of a hybrid multi-volume structure key-value storage system in a cloud environment, the operation method further comprising: regularly adjusting the resources allocated to each Bcache in the persistent read cache volume, the resources including the capacity size and the IOPS upper limit size:
[0131] Scenario 1: If the difference in heat between each data volume and other data volumes does not exceed the difference threshold, the resources currently occupied by each Bcache will not be modified. The heat is the average number of accesses per unit time within the set period.
[0132] Scenario 2: If the difference in popularity between two data volumes exceeds the difference threshold, and the Bcache corresponding to the data volume with the highest popularity has not currently reached its IOPS limit, the capacity of the Bcache corresponding to the data volume with the highest popularity will be increased, and the capacity of the remaining Bcache will be adjusted according to the access popularity of the corresponding data volumes. The higher the access popularity, the larger the Bcache capacity.
[0133] Scenario 3: If the difference in popularity between two data volumes exceeds the gap threshold, and the Bcache corresponding to the data volume with the highest popularity has currently reached its IOPS limit, the IOPS limit of the Bcache corresponding to the data volume with the highest popularity will be increased, and the IOPS limits of the remaining Bcaches will be adjusted according to the access popularity of the corresponding data volumes. The higher the access popularity, the greater the IOPS limit of the Bcache.
[0134] In specific operations, you can run the resource allocation submodule to allocate the space size and IOPS occupied by each Bcache. The resource allocation submodule collects the read and write load of each data volume, calculates the heat of each data volume, and allocates the resources occupied by each Bcache according to its heat. Fig. 9The resource allocation flow chart in one embodiment of the present invention is shown as follows: the I / O information of the data volume counted by the statistical scheduling module in the past 30 seconds is recorded, and the average number of read and write times of each data volume is calculated as its heat. When the heat difference between the hottest volume and the coldest volume is greater than 100, the resource allocation submodule believes that there is a large difference in the load intensity between the current data volumes, and will adjust the resources occupied by the Bcache corresponding to each data volume. The resource allocation submodule will determine whether the Bcache corresponding to the hottest volume has remaining tokens when replenishing tokens. If there are remaining tokens, it means that the read and write pressure of the Bcache corresponding to the current hottest volume is not large, and the hit rate is not high. The resource allocation submodule will allocate a larger space size for the Bcache corresponding to the hottest volume, and at the same time, according to the heat of each data volume, the space size occupied by the Bcache corresponding to other data volumes is proportionally reduced; if there are no remaining tokens, it means that the IOPS resources of the Bcache corresponding to the hottest volume are insufficient at this time, and the resource allocation submodule will increase the IOPS occupied by the Bcache corresponding to the hottest volume and reduce the IOPS occupied by the Bcache corresponding to other data volumes.
[0135] When the resource allocation submodule adjusts the resources occupied by each Bcache, the resource allocation submodule will insert the adjusted parameters into the queue, and the background thread will take the adjusted parameters from the queue. If the space size of the Bcache is adjusted, the adjustment is made by modifying the upper limit of the number of cache files that can be written to each Bcache. If the IOPS occupied by the Bcache is adjusted, the adjustment is made by modifying the upper limit of the number of tokens in the token bucket of each Bcache limiter.
[0136] Specifically, for scenario 3, the IOPS limit of any Bcache except the Bcache corresponding to the most popular data volume is updated to N other_new :
[0137] N other_new =max(N other_old -a*(W max -W i ),0)
[0138] Where N other_new The updated IOPS limit of Bcache, N other_old is the IOPS upper limit before Bcache update, a>0 is the preset proportional coefficient, W max is the upper limit of the heat of the corresponding data volume, W i is the current popularity of the corresponding data volume i;
[0139] The IOPS limit of Bcache corresponding to the most popular data volume is updated to N new :
[0140] N new =N old +∑(N other_old -N other_new )
[0141] Where N new The updated IOPS limit of Bcache, N old This is the IOPS limit before Bcache is updated.
[0142] In one embodiment, the operation method also includes: monitoring the heat of the persistent write cache volume, where the heat is the average number of accesses per unit time within a set period: when the heat of the persistent write cache volume does not exceed the set threshold, there is a data volume in the data layer whose heat difference with its data volume IOPS upper limit is less than a preset value, and the Bcache corresponding to the data volume on the persistent read cache has currently reached the IOPS upper limit, then part of the space of the corresponding persistent write cache volume is used to store SSTable files, and the remaining space is used to establish a Bcache to expand the capacity of the persistent read cache volume; when the heat of the persistent write cache volume exceeds the set threshold, the Bcache in the persistent write cache volume is recycled for storing SSTable files.
[0143] Specifically, the resource allocation submodule also monitors the heat of the persistent write cache volume. When the heat of the persistent write cache volume is low and the heat of the persistent read cache volume is high, the resource allocation submodule uses part of the storage space of the two persistent write cache volumes (generally set to 1GB) as the persistent read cache volume, and sets a Bcache in each persistent write cache volume to store hot data in all data volumes. The available IOPS resources are set to a fixed value (generally set to 2000). When the heat of the SSTable file in the persistent write cache volume is high (the heat is higher than 1000), the resource allocation submodule reclaims the storage space of the persistent write cache occupied by the persistent read cache.
[0144] In one embodiment, the following formula is used to calculate the data volume heat of the persistent read cache:
[0145] W t =avg(I (t-1,t] +I (t-2,t-1] +...+I (t-n-1,t-n] )
[0146] Where W t is the heat of the data volume at time t, I (t-1,t] The number of I / Os of the data volume from time t-1 to time t. The heat of each data volume is recalculated and updated every n (n is generally set to 30) seconds.
[0147] Example 4
[0148] This embodiment also proposes an operation method of a hybrid multi-volume structure key-value storage system in a cloud environment, and the operation method further includes:
[0149] Calculate the points of each burst cloud storage volume; when the points of any burst cloud storage volume exceed a preset level, create a new burst cloud storage volume to replace the burst cloud storage volume whose points exceed the preset level;
[0150] When replacing a persistent read cache volume, create a new cloud storage volume, traverse the Bcache in the persistent read cache volume, and perform the following process on each Bcache in the persistent read cache in turn:
[0151] Pause the insertion operation on the current Bcache;
[0152] Flush the cache data in the current memory layer to be inserted into the current Bcache into the current Bcache;
[0153] Copy all data in the current Bcache to the new cloud storage volume;
[0154] Change the current Bcache search path and insertion path to the path where the new cloud storage volume is located;
[0155] Resume the current Bcache insert operation.
[0156] After traversing all Bcaches in the persistent read cache and executing the above process, the original persistent read cache volume is deleted;
[0157] When replacing a persistent write cache volume, execute:
[0158] Create a new cloud storage volume and replace its path with the path of the original persistent write cache volume to ensure that the SSTable files generated by flushing during the data migration process are written to the newly created cloud storage volume;
[0159] Determine whether there is an SSTable file in the original persistent write cache volume. If there is an SSTable file, compress and merge the SSTable files in the original persistent write cache volume and write them to the data volume until all SSTable files are flushed to the data volume.
[0160] Determine whether there is Bcache in the original persistent write cache volume that extends the persistent read cache. If so, copy the data in Bcache in the persistent write cache to the newly created cloud storage volume according to the process of replacing the persistent read cache volume.
[0161] Delete the original persistent write cache volume.
[0162] This embodiment uses the credit monitoring and cache volume replacement mechanism to prevent the sudden increase of storage volumes (Amazon EBS gp2 cloud storage volumes in this embodiment) used as read-write cache from experiencing a sharp drop in performance due to credit exhaustion, thereby affecting the system's read-write performance. In the specific operation, the credit monitoring and cache volume replacement module is run to perform this operation. The credit monitoring and cache volume replacement module will record the reading and writing status of each cache volume by the statistical scheduling module, and calculate the credits of each cache volume based on the reading and writing status of each cache volume. When the credits of the cache volume are low, the credit monitoring and cache volume replacement module will first create a new cloud storage volume, and then, according to the different types of cache volumes, different processes will be used to migrate the data in the persistent write cache volume and the persistent read cache volume.
[0163] In one embodiment, the following formula is used to calculate the score of each cloud storage volume in the persistent cache layer:
[0164]
[0165] Where St is the credit number of the corresponding cloud storage volume in the persistent cache layer at time t, Smax is the maximum credit number of the corresponding cloud storage volume, and is also its initial credit number, S t-1 is the number of points of the corresponding cloud storage volume at time t-1, C is the capacity of the corresponding cloud storage volume (in GB), I (t-1,t] It is the number of I / Os of the corresponding cloud storage volume from time t-1 to time t.
[0166] Specifically, when the points of the persistent read cache volume are less than 20%, the persistent read cache volume will be replaced. The process of replacing the persistent read cache volume is as follows: Fig.10 First, create a new cloud storage volume and then traverse the Bcache in the persistent read cache volume, and perform the following process on each Bcache in the persistent read cache in turn:
[0167] (1) Pause the insertion operation on the Bcache;
[0168] (2) flush the cached data in the current memory to the cloud storage volume;
[0169] (3) Copy all cached files in the Bcache to the newly created cloud storage volume, and limit the read rate of the cached files in the original Bcache during the copy process;
[0170] (4) Modify the search path and insertion path of the Bcache to the path where the new cloud storage volume is located;
[0171] (5) Resume the insertion operation of the Bcache.
[0172] After traversing all Bcaches in the persistent read cache and executing the above process, the original persistent read cache volume is deleted.
[0173] When the points of the persistent write cache volume are less than 20%, the persistent write cache volume will be replaced. The process of replacing the persistent write cache volume is as follows: Fig.11 As shown:
[0174] (1) Create a new cloud storage volume and replace its path with the path of the original persistent write cache volume to ensure that the SSTable files generated during the data migration process are written to the newly created cloud storage volume.
[0175] (2) Determine whether there is an SSTable file in the original persistent write cache volume. If there is an SSTable file, compress and merge the SSTable file in the persistent write cache volume with the SSTable file of the next layer and write them to the data volume. After the compression and merging is completed, re-determine whether there is an SSTable file in the persistent write cache volume. If there is an SSTable file, wait until all SSTable files are flushed to the data volume.
[0176] (3) Determine whether part of the space in the current persistent write cache volume is used as a persistent read cache. If so, copy the data in Bcache in the persistent write cache to the newly created cloud storage volume according to the process of replacing the persistent read cache volume.
[0177] (4) Delete the original persistent write cache volume.
[0178] Example 5
[0179] The present invention also relates to an operating device for a hybrid multi-volume structure key-value storage system in a cloud environment, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0180] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The memory may be used to store computer programs and / or modules, and the processor may perform various functions of the electronic device by running or executing computer programs and / or modules stored in the memory, and calling data stored in the memory.
[0181] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. It should be noted that "in one embodiment", "for example", "for example", etc. of the present invention are intended to illustrate the present invention, rather than to limit the present invention.
[0182] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent application. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention.
Claims
1. A method for operating a hybrid multi-volume key-value storage system in a cloud environment, characterized in that: The system includes a memory layer, a persistent cache layer and a data layer, the persistent cache layer includes multiple persistent write cache volumes, the data layer has N data volumes, namely, data volume 0 to data volume N-1, N≥2, the persistent write cache volume and the data volume are both cloud storage volumes, the access performance of the cloud storage volume located in the persistent cache layer is better than that of the cloud storage volume located in the data layer, and the capacity of the cloud storage volume located in the persistent cache layer is smaller than that of the cloud storage volume located in the data layer; The operation method includes writing data to the system when a write instruction is received, and the process of writing data includes: Write the key-value data {key, value} into the memory table MemTable of the memory layer; The key-value data in different memory tables MemTable are flushed to different persistent write cache volumes in parallel to form SSTable files of the L0 layer, where the key of the key-value data is stored in the SSTable files; Perform internal compression and merging and inter-layer compression and merging. The internal compression and merging is to compress and merge multiple SSTable files in each of the persistent write cache volumes, and the newly generated SSTable files are written back to the persistent write cache volume. The inter-layer compression and merging is to compress and merge the SSTable files of the Lk layer with the SSTable files of the L(k+1) layer, and write the SSTable files of the L(k+1) layer newly generated by the compression and merging into the selected data volume, where k is the layer index, k=0,1,2,…,n, n is the total number of layers, and L1~Ln layers are in each data volume; Among them, after the upper SSTable file is compressed and merged with the lower SSTable file, the data volume to which the newly generated SSTable file of the lower layer will be written is selected according to the following method: The key range from the global minimum key to the maximum key recorded in the system is evenly divided into m intervals, from interval 0 to interval m-1, where m is a preset positive integer; Determine the index idx of the interval where the minimum key in the newly generated SSTable file is located; The index of the data volume to which the newly generated SSTable file is to be written is calculated as Index = (idx + level) % N, where level is the index of the layer where the newly generated SSTable file is located, Index is the index of the data volume, and % is a modulo operation.
2. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 1, characterized in that: The persistent cache layer also includes a persistent read cache volume, which is a cloud storage volume. The persistent read cache volume is divided into N independent persistent block caches Bcaches, and the N Bcaches correspond to the N data volumes one by one. The operation method also includes reading data from the system when a read instruction is received. The process of reading data includes: Search from the system's current Memtable; if it does not hit in the Memtable, search in all L0SSTable files in the persistent write cache; if it still does not hit, search in the persistent read cache; The process of reading data from the persistent read cache includes: Locate the corresponding Bcache based on the data volume where the target data block is located, and determine whether the located Bcache has the target data block and whether the located Bcache has reached its IOPS limit: If the located Bcache has the target data block and its IOPS limit has not been reached, obtain the access token of the located Bcache and read the target data block from the located Bcache; If the located Bcache does not have the target data block or has currently reached its IOPS limit, the target data block is read from the located data volume and the read target data block is inserted into the corresponding Bcache.
3. The method for operating a hybrid multi-volume key-value storage system in a cloud environment as claimed in claim 2, characterized in that: Each Bcache corresponds to a hash table, and the hash table is used to index each data block in the Bcache; Insert the target data block read from the located data volume into the corresponding Bcache, including: Locate the corresponding Bcache based on the data volume where the target data block is located; Determine whether the target data block exists in Bcache based on the hash table corresponding to Bcache: If it exists, the Bcache is not inserted; If it does not exist, the target data block is first inserted into the blocking queue of the memory layer; The data blocks in the blocking queue are taken out sequentially through the background thread. Each time a data block is taken out, an application is made to obtain the access token of the Bcache to be written. After the access token is obtained, the taken data block is inserted into the cache file of Bcache, and the index of the cache file where the inserted data block is located and the offset of the data block inserted into the cache file are recorded in the hash table. One cache file corresponds to one SSTable file. After each cache file is written, the file pointer of the corresponding cache file is inserted into the head of the corresponding Bcache's doubly linked list. If Bcache is full when the data block is inserted, the cache space at the tail of the doubly linked list is released.
4. The method for operating a hybrid multi-volume key-value storage system in a cloud environment as claimed in claim 2, characterized in that: The token bucket algorithm is used to manage the access token of each Bcache in the persistent read cache volume: A corresponding limiter is set for each Bcache, and each limiter stores a token bucket corresponding to the Bcache. The limiter updates the number of remaining access tokens in the token bucket corresponding to the Bcache to its IOPS upper limit at the initial moment of each access cycle. In the current access cycle, when access to the Bcache is required, an access token is first applied to the limiter corresponding to the Bcache. If there are remaining tokens in the token bucket, an access token is taken out of the token bucket and the corresponding Bcache is accessed. The number of remaining tokens in the token bucket is reduced by 1. If there are no remaining tokens in the token bucket, the access token cannot be obtained in the current access cycle.
5. The method for operating a hybrid multi-volume structure key-value storage system in a cloud environment as claimed in claim 2, characterized in that: The total resources occupied by all Bcaches in the persistent read cache volume are fixed. The operation method further includes periodically adjusting the resources allocated to each Bcach in the persistent read cache volume, wherein the resources include the capacity size and the IOPS upper limit size: Scenario 1: If the difference in heat between each data volume and other data volumes does not exceed the difference threshold, the resources currently occupied by each Bcache will not be modified. The heat is the average number of accesses per unit time within a set period. Scenario 2: If the difference in popularity between two data volumes exceeds the difference threshold, and the Bcache corresponding to the data volume with the highest popularity has not currently reached its IOPS limit, the capacity of the Bcache corresponding to the data volume with the highest popularity will be increased, and the capacity of the remaining Bcache will be adjusted according to the access popularity of the corresponding data volumes. The higher the access popularity, the larger the Bcache capacity. Scenario 3: If the difference in popularity between two data volumes exceeds the gap threshold, and the Bcache corresponding to the data volume with the highest popularity has currently reached its IOPS limit, the IOPS limit of the Bcache corresponding to the data volume with the highest popularity will be increased, and the IOPS limits of the remaining Bcaches will be adjusted according to the access popularity of the corresponding data volumes. The higher the access popularity, the greater the IOPS limit of the Bcache.
6. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 5, characterized in that: In scenario three: The IOPS limit of any Bcache except the Bcache corresponding to the most popular data volume is updated to N other_new : N other_new =max(N other_old -a*(W max -W i ),0) Where N other_new The updated IOPS limit of Bcache, N other_old is the IOPS upper limit before Bcache update, a>0 is the preset proportional coefficient, W max is the upper limit of the heat of the corresponding data volume, W i is the current popularity of the corresponding data volume i; The IOPS limit of Bcache corresponding to the most popular data volume is updated to N new : N new =N old +∑(N other_old -N other_new ) Where N new The updated IOPS limit of Bcache, N old This is the IOPS limit before Bcache is updated.
7. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 2, characterized in that: The operation method further includes: Monitor the heat of the persistent write cache volume, which is the average number of accesses per unit time within a set period: When the heat of the persistent write cache volume does not exceed the set threshold, there is a data volume in the data layer whose heat difference with its data volume IOPS upper limit is less than the preset value, and the Bcache corresponding to the data volume on the persistent read cache has currently reached the IOPS upper limit, part of the space of the corresponding persistent write cache volume is used to store SSTable files, and the remaining space is used to establish a Bcache to expand the capacity of the persistent read cache volume; when the heat of the persistent write cache volume exceeds the set threshold, the Bcache in the persistent write cache volume is reclaimed for storing SSTable files.
8. The method for operating a hybrid multi-volume key-value storage system in a cloud environment as claimed in claim 2, characterized in that: The persistent write cache volume and the persistent read cache volume are both burst cloud storage volumes, and the operation method further includes: calculating the points of each burst cloud storage volume; when the points of any burst cloud storage volume exceed a preset level, creating a new burst cloud storage volume to replace the burst cloud storage volume whose points exceed the preset level; When replacing a persistent read cache volume, create a new cloud storage volume, traverse the Bcache in the persistent read cache volume, and perform the following process on each Bcache in the persistent read cache in turn: Pause the insertion operation on the current Bcache; Flush the cache data in the current memory layer to be inserted into the current Bcache into the current Bcache; Copy all data in the current Bcache to the new cloud storage volume; Change the current Bcache search path and insertion path to the path where the new cloud storage volume is located; Resume the current Bcache insert operation. After traversing all Bcaches in the persistent read cache and executing the above process, the original persistent read cache volume is deleted; When replacing a persistent write cache volume, execute: Create a new cloud storage volume and replace its path with the path of the original persistent write cache volume to ensure that the SSTable files generated by flushing during the data migration process are written to the newly created cloud storage volume; Determine whether there is an SSTable file in the original persistent write cache volume. If there is an SSTable file, compress and merge the SSTable files in the original persistent write cache volume and write them to the data volume until all SSTable files are flushed to the data volume. Determine whether there is Bcache in the original persistent write cache volume that extends the persistent read cache. If so, copy the data in Bcache in the persistent write cache to the newly created cloud storage volume according to the process of replacing the persistent read cache volume. Delete the original persistent write cache volume.
9. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 8, characterized in that: The calculation formula for calculating the credits of each cloud storage volume in the persistent cache layer is: Where St is the credit of the corresponding cloud storage volume in the persistent cache layer at time t, Smax is the maximum credit of the corresponding cloud storage volume, and is also its initial credit, S t-1 is the credit number of the corresponding cloud storage volume at time t-1, C is the capacity of the corresponding cloud storage volume, I (t-1,t] It is the number of I / Os of the corresponding cloud storage volume from time t-1 to time t.
10. An operating device for a hybrid multi-volume structure key-value storage system in a cloud environment, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Data compression method based on Bigtable distributed storage system
CN103812877A
Data storage method and device, processing equipment and storage medium
CN116774937A
Adaptive prefix tree based order partitioned data storage system
US20170212680A1
Key-value stores with optimized merge policies and optimized LSM-tree structures
US20200341889A1
Memory system, operating method of memory system, and computer-readable recording medium performing same
WO2023106635A1
Cited By
Capacity reduction method and device of storage system, electronic equipment and storage medium
CN119440413A
Current limiting method and device of data operation unit, electronic equipment and storage medium
CN120687267A
