Separated Database Row Cache Keys Across LSM-Tree Merges
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The inefficient usage of the row cache in log structured merge (LSM) trees due to short-duration merge operations, leading to suboptimal performance in cache memory systems.
Innovation Solution
Implementing a row cache key (RCK) composed of a row cache identifier, column family identifier, and KV key, without relying on file identifiers, and incorporating snapshot identifiers to manage cache entries, ensuring validity and expanding the relevancy window of cached content.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If row cache key includes file identifier to identify content, then content can be properly identified and cached, but cache entry lifetime becomes short due to merge operations causing inefficient cache usage
Solution Approach 1:
The patent segments the row cache key into multiple components: table identifier, snapshot identifier, and KV key. This segmentation allows each component to serve a specific purpose - the table identifier identifies the database table, the snapshot identifier provides temporal context for data versions, and the KV key identifies the specific key-value pair. This structured approach resolves the contradiction by enabling long cache lifetimes through snapshot-based versioning while maintaining reliability through proper identification of cached content.
Solution Approach 2:
The patent implements preliminary action by creating snapshot identifiers that capture the state of data at specific points in time before merge operations occur. By pre-establishing these snapshot identifiers and associating them with cache entries, the system ensures that cache entries remain valid even as underlying data undergoes merge operations. This preliminary capture of data state allows the cache to maintain reliability without being invalidated by subsequent merge operations, thereby extending cache entry lifetime.
2Measurement precision
If row cache key depends on file identifier, then content identification is accurate, but access errors occur during merge operations reducing cache utilization efficiency
Solution Approach 1:
The patent introduces snapshot identifier as an intermediary element between the file identifier and the KV key. The snapshot identifier acts as a mediator that decouples the cache key from direct file identifier dependencies. Instead of directly linking cache entries to file identifiers (which causes access errors during merges), the system uses snapshot identifiers to establish a stable reference point. This intermediary approach maintains content identification accuracy while preventing access errors during merge operations, thereby improving cache utilization efficiency.
Solution Approach 2:
The patent changes the parameter structure of the row cache key from a simple file identifier-based scheme to a multi-parameter structure including table identifier, snapshot identifier, and KV key. This parameter change fundamentally alters how content is identified and cached. By incorporating snapshot identifiers, the system can accurately identify content without relying on file identifiers that change during merges. This parameter transformation resolves the contradiction by maintaining identification accuracy while eliminating access errors, thus improving productivity and cache utilization efficiency.
3Reliability
If frequent cache invalidations are performed to ensure data validity, then data accuracy is maintained, but performance deteriorates due to increased invalidation overhead
Solution Approach 1:
The patent applies preliminary action by pre-establishing snapshot identifiers that capture data states at specific points in time. These snapshot identifiers are created before merge operations occur and are used to label cache entries. By doing so, the system eliminates the need for frequent cache invalidations to maintain data validity. The snapshot identifiers serve as built-in versioning mechanisms that automatically ensure data accuracy without requiring active invalidation management, thereby maintaining both reliability and performance.
Solution Approach 2:
The patent enables continuity of useful action by using snapshot identifiers to maintain cache entries across merge operations. Instead of invalidating and recreating cache entries when merges occur, the system continues to serve cached data using the snapshot identifier as a reference to the correct data version. This approach maintains data validity continuously without interruption, eliminating the performance penalty associated with frequent invalidations while ensuring ongoing data accuracy.
Data Source
AI summary
A method for updating a key-value (KV) storage system, the method includes (i) receiving a request to write a KV key to a row cache of the KV storage system, wherein the request is associated with a row cache key (RCK), wherein the RCK comprises a row cache identifier (RCID) and a column family identifier (CFID), wherein the KV storage system further comprises a separated database, the separated database comprises a log structured merge (LSM) tree and KV database that is separated from LSM tree; and (ii) invalidating, responsive to the reception of the request, any KV key already cached in the row cache and associated with a same RCK as the RCK associated with the request.


