LSM Tree Level Sizing for Read Amplification Reduction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current data processing systems, such as those using RocksDB with a Log Structured Merge (LSM) storage engine, face challenges in reading performance due to high reading amplification factors caused by mixing hot and cold keys during compaction and not optimizing data storage based on access patterns.

Innovation Solution

A data processing method that dynamically adjusts the size of each level in the LSM tree based on the total size of read hot keys, by determining a reading hotness threshold, acquiring hot keys, calculating the total size of read hot keys, and adjusting the level sizes accordingly to optimize storage and retrieval.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If data is stored using traditional LSM tree compaction without hot key separation, then storage structure is simple, but reading performance deteriorates due to high reading amplification factor

Engineering Contradiction:
Improvereading performanceVSAvoidstorage structure complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent segments the LSM tree into multiple levels (L0-L6) with different compaction strategies. Hot keys are separated and kept in upper levels (L0-L3) with smaller compaction ratios, while cold keys are moved to lower levels (L4-L6) with larger compaction ratios. This segmentation reduces reading amplification for hot keys while maintaining storage efficiency for cold keys.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements dynamic adjustment of level sizes and compaction ratios based on hot key identification. The system dynamically determines which keys are hot vs. cold and adjusts the LSM tree structure accordingly, rather than using fixed compaction parameters. This dynamic approach optimizes reading performance for frequently accessed keys while maintaining overall system efficiency.

Inventive Principle:
Principle #15Dynamics

2Quantity of substance

If compaction ratio is increased to improve storage efficiency, then storage capacity increases, but reading performance for hot keys deteriorates

Engineering Contradiction:
Improvestorage capacityVSAvoidreading performance
Core Design Contradiction:
Quantity of substanceVSEase of operation

Solution Approach 1:

The patent applies different compaction ratios to different regions of the LSM tree based on local data characteristics. Upper levels containing hot keys use smaller compaction ratios (1:1 to 1:4) to maintain reading performance, while lower levels containing cold keys use larger compaction ratios (1:5 to 1:10) to maximize storage capacity. This local differentiation resolves the contradiction between storage efficiency and reading performance.

Inventive Principle:
Principle #3Local quality

3Ease of manufacture

If all keys are compacted uniformly, then compaction process is simple, but memory costs increase due to unnecessary data retention

Engineering Contradiction:
Improvecompaction process simplicityVSAvoidmemory cost
Core Design Contradiction:
Ease of manufactureVSLoss of substance

Solution Approach 1:

The patent extracts hot keys from the general compaction process and handles them separately with different parameters. By identifying and separating hot keys, the system avoids unnecessary retention of cold keys in upper levels, reducing memory costs while maintaining simplicity through automated identification and separate handling of different key types.

Inventive Principle:
Principle #2Taking out (Extraction)

4Ease of operation

If level sizes are fixed, then system operation is simple, but adaptability to different workload patterns deteriorates

Engineering Contradiction:
Improvesystem operation simplicityVSAvoidworkload pattern adaptability
Core Design Contradiction:
Ease of operationVSAdaptability or versatility

Solution Approach 1:

The patent implements dynamic level size adjustment based on workload analysis. The system monitors access patterns and automatically adjusts the size of each level and compaction ratios to match current workload characteristics. This dynamic adaptation maintains simplicity through automated adjustment while providing versatility across different workload patterns including read-heavy, write-heavy, and mixed workloads.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS12326844B2Data processing method and data processing device
Publication Date: 2025.06.10 SAMSUNG ELECTRONICS CO LTD
  • US12326844B2 patent drawing
  • US12326844B2 patent drawing
  • US12326844B2 patent drawing

AI summary

A data processing method and device are provided. The data processing method includes acquiring hot keys read from a log structure merge (LSM) tree within a preset duration, determining a total size of the read hot keys, and adjusting a size of each of a plurality of levels of the LSM tree based on the total size of the read hot keys.