Prefetching Keys for Garbage Collection in Key-Value Stores
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional relational databases face limitations such as inability to scale out for large data storage, inefficient memory allocation, and difficulty in representing complex relationships between objects, leading to performance issues and data availability problems.
Innovation Solution
The implementation of a key-value store using a log structured merge tree, which allows for flexible data structure without predefinition, efficient storage and retrieval of data, and improved performance through defragmentation and prefetching of keys during garbage collection.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If traditional relational databases are used to store data, then data can be stored in structured tables with predefined schemas, but the system cannot scale out to store large quantities of data across different servers and experiences performance degradation
Solution Approach 1:
The patent divides the database into distributed key-value stores across multiple servers, where each server maintains independent key-value pairs. This segmentation allows horizontal scaling while maintaining fast access performance through local caching and distributed architecture.
Solution Approach 2:
The patent transitions from traditional row-column table structures to a key-value dimension model, where data is accessed through hierarchical key paths (e.g., database.table.row.column). This dimensional change enables flexible querying and efficient storage without the rigidity of predefined schemas.
2Ease of operation
If memory is allocated for data entries in relational databases, then data can be stored with structured organization, but memory usage increases even when fields contain no actual data
Solution Approach 1:
The patent extracts only the essential key-value pairs needed for data storage, eliminating the need for pre-allocated memory for optional fields. Data is stored compactly as key-value pairs with optional nesting, allocating memory only for actual data present rather than for potential data structures.
Solution Approach 2:
The patent changes the storage parameter from fixed-width relational fields to variable-length key-value pairs. This allows memory allocation to dynamically match the actual data size, reducing waste from empty or null fields while maintaining structured organization through hierarchical key paths.
3Quantity of substance
If garbage collection is performed on key-value stores, then unused data can be reclaimed, but the process becomes time-consuming when keys must be read from storage for each garbage collection round
Solution Approach 1:
The patent implements prefetching of keys into memory before garbage collection rounds begin. By proactively loading keys that are likely to be needed for garbage collection into memory caches, the system prepares data in advance, reducing the time required during actual garbage collection execution.
Solution Approach 2:
The patent maintains continuous key prefetching operations that run parallel to or between garbage collection rounds. This ensures that keys are continuously loaded into memory as they become needed, eliminating idle time during garbage collection and maintaining continuous productive action.
4Device complexity
If keys are stored without considering their prefixes, then storage is simple, but read amplification and write amplification increase due to scattered key locations
Solution Approach 1:
The patent merges keys with similar prefixes into the same storage locations or cache lines. By combining related keys physically in storage, the system reduces the number of I/O operations needed to access multiple keys, thereby reducing read and write amplification while maintaining organizational simplicity through prefix-based grouping.
Data Source
AI summary
Techniques are provided for implementing a garbage collection process and a prediction read ahead mechanism to prefetch keys into memory to improve the efficiency and speed of the garbage collection process. A log structured merge tree is used to store keys of key-value pairs within a key-value store. If a key is no longer referenced by any worker nodes of a distributed storage architecture, then the key can be freed to store other data. Accordingly, garbage collection is performed to identify and free unused keys. The speed and efficiency of garbage collection is improved by dynamically adjusting the amount and rate at which keys are prefetched from disk and cached into faster memory for processing by the garbage collection process.


