Operation method and device of hybrid multi-volume structure key-value storage system in cloud environment
By using a hybrid multi-volume key-value storage system and adopting parallel writing and dynamic resource adjustment, the problem of load imbalance between cloud storage volumes is solved, and access efficiency and performance are improved.
Patent Information
- Application Number
- CN202410819606.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-06-24
AI Technical Summary
The existing LSM-Tree key-value storage system cannot fully utilize the cloud storage performance in the multi-cloud storage volume scenario due to the unbalanced load between the cloud storage volumes, which affects the access efficiency.
A hybrid multi-volume key-value storage system is used, including a memory layer, a persistent cache layer, and a data layer. Data access paths and load balancing are optimized through parallel writing to multiple persistent write cache volumes, dynamic adjustment of Bcache resources, point monitoring, and cache volume replacement mechanisms.
It achieves load balancing among cloud storage volumes, improves data access efficiency, enhances system performance and resource utilization, and avoids performance degradation caused by sudden depletion of storage volume points.
Smart Images

Figure CN118838540B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to information storage, and more specifically, relates to an operating method and device for 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 offer data storage and management services by integrating large-scale storage, computing, and network resources within data centers. They also ensure data reliability and performance through technologies like erasure coding and load balancing. Compared to traditional local storage options like non-volatile memory (NVM), solid-state drives (SSDs), and hard disk drives (HDDs), cloud storage offers high scalability, high reliability, fast recovery, high performance, and a pay-as-you-go storage model, effectively meeting the storage needs of various enterprises while also providing 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, significantly driving 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, cloud storage volumes have significant latency differences under different load pressures. In the existing LSM-Tree key-value storage system in the multi-cloud storage volume scenario, due to the unbalanced load between the cloud storage volumes, it cannot fully utilize the cloud storage performance, affecting access efficiency. Summary of the Invention
[0004] In response to the above defects or improvement needs of the existing technology, the present invention provides an operating 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 each cloud storage volume and improve access efficiency.
[0005] To achieve the above objectives, according to one aspect of the present invention, a method for operating a hybrid multi-volume structure key-value storage system in a cloud environment is provided, wherein the system includes a memory layer, a persistent cache layer, and a data layer, wherein the persistent cache layer includes multiple persistent write cache volumes, and the data layer has N data volumes, namely, data volume 0 to data volume N-1, where N ≥ 2. The persistent write cache volumes and data volumes are both cloud storage volumes, and the access performance of the cloud storage volumes in the persistent cache layer is better than that of the cloud storage volumes in the data layer, and the capacity of the cloud storage volumes in the persistent cache layer is smaller than that of the cloud storage volumes in the data layer. The operating method includes writing data to the system when a write instruction is received, and the process of writing data includes:
[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 at the L0 layer, where the key of the key-value data is stored in the SSTable files;
[0008] Perform internal compression merging and inter-layer compression merging. The internal compression 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 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 newly generated SSTable files of the L(k+1) layer into the selected data volume. k is the layer index, k=0,1,2,…,n, n is the total number of layers, and L1 to 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 be written to the newly generated SSTable file 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 the 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, and the persistent read cache volume is divided into N independent persistent block caches Bcaches, and the N Bcaches correspond to the N data volumes in a one-to-one manner. 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 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;
[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, determine whether the located Bcache contains the target data block, and whether the located Bcache has currently reached its IOPS limit:
[0017] If the target data block exists in the located Bcache 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 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 blocks 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 by 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 obtaining the access token, the taken out 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 the token bucket of the corresponding Bcache. The limiter updates the number of access tokens remaining in the corresponding Bcache token bucket to its IOPS upper limit at the beginning of each access cycle. During the current access cycle, when access to the Bcache is required, an access token is first requested from the limiter corresponding to the Bcache. If there are remaining tokens in the token bucket, an access token is taken from 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, no access token can be obtained during the current access cycle.
[0028] In some embodiments, 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 capacity and IOPS upper limit.
[0029] Scenario 1: If the difference in popularity between each data volume and other data volumes does not exceed the difference threshold, the current Bcache resources occupied by each data volume are not modified. The popularity is the average number of accesses per unit time within a set period.
[0030] Scenario 2: If the difference in popularity between two volumes exceeds the threshold, and the Bcache corresponding to the most popular volume has not yet reached its IOPS limit, the capacity of the Bcache corresponding to the most popular volume will be increased. The capacity of the remaining Bcache volumes will be adjusted based on the popularity of the corresponding 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 most popular data volume has reached its IOPS limit, the IOPS limit of the Bcache corresponding to the most popular data volume will be increased. The IOPS limits of the remaining Bcache volumes will be adjusted based on the access popularity of the corresponding data volumes. The higher the access popularity, the larger the Bcache IOPS limit.
[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] Where, Nother_new N is the updated IOPS limit for Bcache. 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 N is the updated IOPS limit for Bcache. old This is the IOPS limit before the Bcache update.
[0039] In some embodiments, the operating method further includes:
[0040] Monitor the popularity 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 the IOPS upper limit of its data volume 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 recycled 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 operating 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, a new cloud storage volume is created, the Bcaches in the persistent read cache volume are traversed, and the following process is performed on each Bcach in the persistent read cache in turn:
[0044] Pause the insertion operation on the current Bcache;
[0045] Flush the cached 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 of the new cloud storage volume;
[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 are SSTable files in the original persistent write cache volume. If there are SSTable files, 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 to extend 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 number of points corresponding to the cloud storage volume in the persistent cache layer at time t, Smax is the maximum number of points corresponding to the cloud storage volume, and is also its initial number of points, S t-1 is the number of points corresponding to the cloud storage volume at time t-1, C is the capacity of the corresponding cloud storage volume, I (t-1,t] The number of I / Os to the corresponding cloud storage volume from time t-1 to time t.
[0058] According to one aspect of the present invention, an operating device for a hybrid multi-volume structure key-value storage system in a cloud environment is provided, 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, the above technical solutions conceived by the present invention have the following beneficial effects compared with the prior art:
[0060] 1. The present invention proposes a key-value storage system with a hybrid multi-storage volume structure in a cloud environment. The system consists of a memory layer, a persistent cache layer, and a data layer. Both the persistent write cache volume and the data volume are cloud storage volumes. The cloud storage volumes in the persistent cache layer have better access performance than the cloud storage volumes in the data layer, and the cloud storage volumes in the persistent cache layer have smaller capacity than the cloud storage volumes 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, greatly improving the data access efficiency of the storage system.
[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 fully utilizes 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 the 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, the SSTable files on the 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 system read performance is improved by fully utilizing the low read and write latency and the IOPS provided by the persistent read cache volume.
[0063] 4. Furthermore, by dynamically adjusting the corresponding Bcache resources based on the popularity of different data volumes, the load on the hot data volumes can be shifted more to the persistent read cache volume, while the less popular data volumes will receive more read and write requests, thus achieving load balancing across the data volumes. In addition, by borrowing part of the space of the less popular persistent write cache volume, the persistent read cache can be dynamically expanded and contracted, further improving resource utilization.
[0064] 5. Furthermore, a credit monitoring and cache volume replacement mechanism is proposed to prevent the sudden increase in read and write latency of persistent read and write cache volumes from impacting overall performance after credits are exhausted. The system monitors the credit status of cache volumes in real time and automatically creates new cloud storage volumes to replace old ones when credits are low. During the replacement process, different replacement strategies are adopted for cache volumes with different uses and the copy data rate is limited, effectively reducing the performance impact of cache volume replacement. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is a schematic diagram of the structure of a hybrid multi-volume key-value storage system in a cloud environment according to one embodiment of the present invention;
[0066] Figure 2 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 and merging in one embodiment of the present invention;
[0068] Figure 4 is a schematic diagram of inter-layer compression and merging in one embodiment of the present invention;
[0069] Figure 5 FIG2 is a schematic diagram of a persistent read cache module divided 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] FIG7( a ) is a flow chart of steps for searching a data block in a persistent read cache according to an embodiment of the present invention;
[0072] FIG7( b ) is a flow chart of the steps of inserting a data block into a persistent read cache according to an 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] Figure 9 is a resource allocation flow chart in one embodiment of the present invention;
[0075] Figure 10 This is a flowchart of replacing a persistent read cache volume in one embodiment of the present invention;
[0076] Figure 11 This 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 objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining 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 may be combined with each other as long as they do not conflict with each other.
[0078] like Figure 1 Figure 2 shows a schematic diagram of a hybrid multi-volume key-value storage system in a cloud environment, according to one embodiment of the present invention. This key-value storage system uses an LSM-Tree structure as its storage engine. This embodiment is based on RocksDB and is implemented as an extension. The system consists of 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 information such as the load intensity, popularity, and points of each cloud storage volume.
[0080] The persistent cache layer uses multiple smaller, higher-performance burst storage volumes, specifically Amazon EBS gp2 cloud storage volumes. For example, using two burst storage volumes as persistent write cache volumes, the in-memory MemTable is flushed to generate L0-layer SSTable files and then written to the two persistent write cache volumes in parallel. Furthermore, a single 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 large-capacity, low-performance, and low-cost cloud storage volumes as data volumes to store large amounts of data. Specifically, Amazon EBS gp3 cloud storage volumes can be used. SSTable files in the persistent write cache are asynchronously written to the data volumes 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] For the hybrid multi-volume 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 operating method for 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 illustrating data flush compression during writing according to 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 newly generated SSTable files of the L(k+1) layer into the selected data volume. k is the layer index, k=0,1,2,…,n, n is the total number of layers, and L1 to 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 be written to the newly generated SSTable file 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 the 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 data from the memory layer to the persistent write cache layer. Generally speaking, when the MemTable is full, 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 these two immutable MemTables into the flush queue, and allocates two threads from the flush thread pool to execute the flush operations of these two immutable MemTables respectively, and write them to two different persistent write cache volumes.
[0098] During 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 the internal compression and merging in one embodiment of the present invention. The internal compression and merging submodule regularly 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 one embodiment of the present invention. The inter-layer compression and merging submodule counts the current bandwidth of each data volume and selects 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 based on 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 system are counted in real time. The global maximum key range is evenly divided into multiple intervals. Each interval is a specified key range. For example, if there are 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 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 divided into multiple Bcaches in one embodiment of the present invention. The persistent read cache volume is divided into N independent persistent block caches (Bcaches), and the N Bcaches correspond one to one with the N data volumes. 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. Each data volume is allocated an independent persistent block cache (Bcache) to cache the hot data blocks of the SSTable files on its corresponding data volume.
[0110] This embodiment also provides an operating method for a hybrid multi-volume key-value storage system in a cloud environment. The operating method further 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, determine whether the located Bcache contains the target data block, and whether the located Bcache has currently reached its IOPS limit:
[0114] If the target data block exists in the located Bcache 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 inserted into the corresponding Bcache.
[0116] like Figure 6 Figure 1 shows a schematic diagram of the Bcache structure in one embodiment of the present invention. Bcache is used to manage hot data blocks in SSTable files on corresponding data volumes. Multiple data blocks in Bcache are organized into a cache file, each of which is an SSTable file. A bidirectional linked list and hash table for Bcache are established and maintained in memory, responsible for indexing cached data. A blocking queue is also maintained to store data to be inserted into the Bcache. Bcache manages data at the cache file level using a least recently used (LRU) algorithm.
[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 access tokens remaining in the token bucket of the corresponding 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 policy. During 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 during the current access cycle.
[0118] Figure 7(a) shows a flowchart of the steps involved in searching for a data block in a persistent read cache according to one embodiment of the present invention. The flowchart includes: locating the Bcache to be searched based on the data volume where the data block to be searched resides, then searching the Bcache's hash table to see if the data block is already cached. If a hit indicates that the current data block is not cached, a direct return is made. If the data block is already cached, a token must be obtained from the limiter. If the token is successfully obtained, the data block in the corresponding cache file is read. If the token is not successfully obtained, a direct return is made. This is to avoid a large number of read requests being blocked in the persistent read cache, which would cause a significant increase in latency. Finally, to maintain the LRU algorithm and facilitate subsequent elimination, the pointer to the read cache file must be moved to the head of the doubly 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] Determine whether the target data block exists in Bcache based on the hash table corresponding to 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 by 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 obtaining the access token, the taken out 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 for 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 there is no hit, it means that the data block currently being inserted is not cached in the Bcache, and the data block to be inserted is inserted into the blocking queue; if there is a hit, it means that the data block currently being inserted has been cached in the Bcache, so it returns directly. The background thread will continuously take out the data blocks to be inserted from the blocking queue and store them in the write cache. After taking out the data blocks to be inserted, it first needs to obtain the limiter token, then write the data blocks 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 Figure 1 is a schematic diagram of a token bucket algorithm in accordance with an embodiment of the present invention. Since a read operation can complete the read process by reading data from the data volume if a token cannot be obtained, while a write operation must obtain a token to complete the write operation, the limiter must adopt different processes for read and write operations.
[0127] The limiter operates as follows for read operations: When a read operation attempts to acquire a token, it first checks whether more than one second has passed since the last token replenishment. If so, it replenishes the token bucket to the upper limit, then atomically decrements the number of remaining tokens in the bucket by one, and finally checks whether the current number of remaining tokens is less than zero. If so, it indicates that there are no remaining tokens. The limiter increments the number by one and returns false, indicating that the token acquisition failed. If the number of remaining tokens is greater than or equal to zero, it indicates that the token acquisition was successful and returns true.
[0128] The overall flow control process of the limiter for write operations is similar to the flow control process for read operations. The only difference is that since the write operation must successfully obtain the token when obtaining the token, 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 provides an operating method for a hybrid multi-volume key-value storage system in a cloud environment. The operating method further includes: regularly adjusting the resources allocated to each Bcache in the persistent read cache volume, the resources including capacity and IOPS upper limit:
[0131] Scenario 1: If the difference in popularity between each data volume and other data volumes does not exceed the gap threshold, the Bcache resources currently occupied by each data volume will not be modified. The popularity is the average number of accesses per unit time within the set period.
[0132] Scenario 2: If the difference in popularity between two volumes exceeds the threshold, and the Bcache corresponding to the most popular volume has not yet reached its IOPS limit, the capacity of the Bcache corresponding to the most popular volume will be increased. The capacity of the remaining Bcache volumes will be adjusted based on the popularity of the corresponding 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 most popular data volume has reached its IOPS limit, the IOPS limit of the Bcache corresponding to the most popular data volume will be increased. The IOPS limits of the remaining Bcache volumes will be adjusted based on the access popularity of the corresponding data volumes. The higher the access popularity, the larger the Bcache IOPS limit.
[0134] In specific operations, you can run the resource allocation submodule to allocate the space 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. Figure 9The following is a resource allocation flow chart for one embodiment of the present invention: The I / O information of the data volumes collected by the statistical scheduling module over the past 30 seconds is recorded, and the average read and write times of each data volume are calculated as its heat. When the heat difference between the hottest and coldest volumes is greater than 100, the resource allocation submodule determines that there is a significant difference in load intensity between the data volumes and adjusts the Bcache resources corresponding to each data volume. The resource allocation submodule determines whether the Bcache corresponding to the hottest volume has remaining tokens when replenishing tokens. If there are remaining tokens, it indicates that the read and write pressure of the Bcache corresponding to the hottest volume is not high, and the hit rate is not high. The resource allocation submodule then allocates more space to the Bcache corresponding to the hottest volume and proportionally reduces the Bcache space occupied by other data volumes based on the heat of each data volume. If there are no remaining tokens, it indicates that the Bcache corresponding to the hottest volume has insufficient IOPS resources. The resource allocation submodule increases the IOPS occupied by the Bcache corresponding to the hottest volume and reduces the IOPS occupied by the Bcache corresponding to other data volumes.
[0135] When the resource allocation submodule adjusts the resources occupied by each Bcache, it inserts the adjusted parameters into the queue, and the background thread retrieves the adjusted parameters from the queue. If the Bcache space size 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 each Bcache limiter token bucket.
[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 N is the updated IOPS limit for Bcache. 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 N is the updated IOPS limit for Bcache. old This is the IOPS limit before the Bcache update.
[0142] In one embodiment, the operating 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 the IOPS upper limit of its data volume 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, 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 persistent read cache volumes. A Bcache is set in each persistent write cache volume to store hot data in all data volumes, and 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 (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 is calculated. The heat of each data volume is recalculated and updated every n seconds (n is generally set to 30).
[0147] Example 4
[0148] This embodiment also provides an operating method for a hybrid multi-volume key-value storage system in a cloud environment, the operating method further comprising:
[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, a new cloud storage volume is created, the Bcaches in the persistent read cache volume are traversed, and the following process is performed on each Bcach in the persistent read cache in turn:
[0151] Pause the insertion operation on the current Bcache;
[0152] Flush the cached 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 of the new cloud storage volume;
[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 are SSTable files in the original persistent write cache volume. If there are SSTable files, 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 to extend 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 a points monitoring and cache volume replacement mechanism to prevent the sudden increase in storage volume (in this embodiment, Amazon EBS gp2 cloud storage volume) used as a read and write cache from experiencing a sharp drop in performance due to the exhaustion of points, thereby affecting the system's read and write performance. During the specific operation, the points monitoring and cache volume replacement module is run to perform this operation. The running points 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 points of each cache volume based on the reading and writing status of each cache volume. When the cache volume points are low, the points monitoring and cache volume replacement module will first create a new cloud storage volume, and then, based on the different types of cache volumes, adopt different processes 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 credits of each cloud storage volume in the persistent cache layer:
[0164]
[0165] Where St is the number of points corresponding to the cloud storage volume in the persistent cache layer at time t, Smax is the maximum number of points corresponding to the cloud storage volume, and is also its initial number of points, S t-1 is the number of points corresponding to the cloud storage volume at time t-1, C is the capacity of the corresponding cloud storage volume (in GB), I (t-1,t] The number of I / Os to 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: Figure 10 First, create a new cloud storage volume and then traverse the Bcaches in the persistent read cache volume. The following process is performed on each Bcach 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 of the new cloud storage volume;
[0171] (5) Resume the Bcache insert operation.
[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: Figure 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 will be 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 it 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 the 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, or a cloud server. The processor may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate 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 the computer programs and / or modules stored in the memory, and calling the data stored in the memory.
[0181] The technical features of the above embodiments can be combined in any manner. To simplify the description, 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 the phrases "in one embodiment", "for example", "and another example", etc. of the present invention are intended to illustrate the present invention and are not intended to limit the present invention.
[0182] The above embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, and all such variations and improvements fall within the scope of protection 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, where N≥2. The persistent write cache volumes and data volumes are both cloud storage volumes. The access performance of the cloud storage volumes in the persistent cache layer is better than that of the cloud storage volumes in the data layer. The capacity of the cloud storage volumes in the persistent cache layer is smaller than that of the cloud storage volumes in the data layer. The operating 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 at the L0 layer, where the key of the key-value data is stored in the SSTable files; Perform internal compression merging and inter-layer compression merging, wherein the internal compression 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 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 newly generated SSTable files of the L(k+1) layer into the selected data volume, where k is the layer index, k=0,1,2,…,n, and n is the total number of layers, and layers L1 to Ln 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 be written to the newly generated SSTable file 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 the modulo operation.
2. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 1, wherein: The persistent cache layer further 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 in a one-to-one manner. The operation method further 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 the match is not found in the Memtable, search in all L0SSTable files in the persistent write cache; if the match is still not found, 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, determine whether the located Bcache contains the target data block, and whether the located Bcache has currently reached its IOPS limit: If the target data block exists in the located Bcache 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 inserted into the corresponding Bcache.
3. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 2, wherein: Each Bcache corresponds to a hash table, which is used to index each data block in the Bcache; Insert the target data blocks 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 by 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 obtaining the access token, the taken out 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 according to claim 2, wherein: A 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 the token bucket of the corresponding Bcache. The limiter updates the number of access tokens remaining in the corresponding Bcache token bucket to its IOPS upper limit at the beginning of each access cycle. During the current access cycle, when access to the Bcache is required, an access token is first requested from the limiter corresponding to the Bcache. If there are remaining tokens in the token bucket, an access token is taken from 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, no access token can be obtained during the current access cycle.
5. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 2, wherein: 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 capacity and IOPS upper limit. Scenario 1: If the difference in popularity between each data volume and other data volumes does not exceed the difference threshold, the current Bcache resources occupied by each data volume are not modified. The popularity is the average number of accesses per unit time within a set period. Scenario 2: If the difference in popularity between two volumes exceeds the threshold, and the Bcache corresponding to the most popular volume has not yet reached its IOPS limit, the capacity of the Bcache corresponding to the most popular volume will be increased. The capacity of the remaining Bcache volumes will be adjusted based on the popularity of the corresponding 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 most popular data volume has reached its IOPS limit, the IOPS limit of the Bcache corresponding to the most popular data volume will be increased. The IOPS limits of the remaining Bcache volumes will be adjusted based on the access popularity of the corresponding data volumes. The higher the access popularity, the larger the Bcache IOPS limit.
6. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 5, wherein: 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 N is the updated IOPS limit for Bcache. 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 N is the updated IOPS limit for Bcache. old This is the IOPS limit before the Bcache update.
7. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 2, wherein: The operation method further includes: Monitor the popularity 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 the IOPS upper limit of its data volume 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 recycled for storing SSTable files.
8. The method for operating a hybrid multi-volume key-value storage system in a cloud environment according to claim 2, wherein: 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, a new cloud storage volume is created, the Bcaches in the persistent read cache volume are traversed, and the following process is performed on each Bcach in the persistent read cache in turn: Pause the insertion operation on the current Bcache; Flush the cached 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 of the new cloud storage volume; 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 are SSTable files in the original persistent write cache volume. If there are SSTable files, 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 to extend 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, wherein: The calculation formula for calculating the credits of each cloud storage volume in the persistent cache layer is: Where St is the number of points corresponding to the cloud storage volume in the persistent cache layer at time t, Smax is the maximum number of points corresponding to the cloud storage volume, and is also its initial number of points, S t-1 is the number of points corresponding to the cloud storage volume at time t-1, C is the capacity of the corresponding cloud storage volume, I (t-1,t] The number of I / Os to the corresponding cloud storage volume from time t-1 to time t.
10. An operating device for a hybrid multi-volume 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