Enabling Efficient Updates in KV Storage via Hashing: Design and Performance Evaluation

Yongkun Li, Helen H. W. Chan, Patrick P. C. Lee, Yinlong Xu

Introduction

Modern key-value (KV) stores, such as LevelDB and RocksDB, predominantly rely on Log-Structured Merge (LSM) trees. While optimized for write performance, LSM-trees suffer from significant I/O amplification due to the constant rewriting of data during compaction. A common optimization, KV separation (e.g., WiscKey), mitigates this by storing large values in a separate circular log. However, this introduces a new bottleneck: Garbage Collection (GC). In update-intensive workloads, the system must frequently clean the log, incurring high metadata lookup costs and excessive write traffic.

Figure 2: Write amplification comparison across different storage engines for Load and Update workloads. Note the high amplification for log-based designs (vLog) during updates.

The HashKV Design

To address the GC bottleneck, we introduce HashKV, a storage engine that utilizes hash-based data grouping. Unlike traditional circular logs that append data sequentially, HashKV partitions the value store into fixed-size "main segments."

Deterministic Mapping and Lightweight GC

HashKV maps values to specific segments by hashing their keys. This deterministic approach makes the value store "self-describing." During GC, the system only needs to scan a single segment to identify valid data—the version closest to the end of the segment is the most recent. This eliminates the need to query the LSM-tree for validity checks, drastically reducing overhead.

Figure 3: The HashKV architecture, illustrating KV separation, segment-based storage, and the use of log segments for dynamic extension.

Dynamic Extensions and Hotness Awareness

To handle data skew and growth, HashKV employs several optimizations:

  • Dynamic Reserved Space: If a main segment exceeds its capacity, HashKV allocates "log segments" from a reserved pool, creating a linked segment group.
  • Hotness Awareness: A "tagging" mechanism identifies cold data, which is then moved to a dedicated "cold data log" to prevent redundant copying during the GC of hot segments.
  • Selective Separation: Small KV pairs remain within the LSM-tree to avoid unnecessary I/O overhead for tiny values.

Performance Evaluation

HashKV was evaluated using the Yahoo! Cloud Serving Benchmark (YCSB) and various synthetic workloads. The results demonstrate significant improvements over state-of-the-art designs:

  • Throughput: HashKV achieves up to 4.6× higher update throughput compared to WiscKey.
  • Write Reduction: It reduces write traffic by 53.4%, significantly extending the lifespan of underlying SSDs.
  • Latency: Average update latency is reduced by up to 20× by eliminating the "GC-Lookup" phase.
  • Generalizability: When integrated into RocksDB, HashKV improved performance by 1.2× to 5.0× across diverse workloads.

Conclusion

HashKV demonstrates that deterministic data placement via hashing is a highly effective strategy for managing value storage in modern KV engines. By rethinking the relationship between keys and their physical storage locations, HashKV overcomes the long-standing garbage collection bottleneck in KV separation designs, offering a scalable and efficient solution for update-heavy applications on modern SSDs.

Summary updated

BibTeX
@article{li2019enabling,
  author = {Yongkun Li and Helen H. W. Chan and Patrick P. C. Lee and Yinlong Xu},
  title = {{Enabling Efficient Updates in KV Storage via Hashing: Design and Performance Evaluation}},
  journal = {ACM Trans. Storage},
  year = {2019},
  doi = {10.1145/3340287},
}
Figure