Towards Flexibility and Robustness of LSM Trees

Andy Huynh, Harshal A. Chaudhari, Evimaria Terzi, Manos Athanassoulis · DOI

Introduction

Log-Structured Merge (LSM) trees serve as the storage backbone for numerous modern key-value stores, including Meta's RocksDB, Google's LevelDB, and Apache Cassandra. Their popularity stems from their high tunability; engineers can adjust parameters such as the size ratio between levels, memory allocation for Bloom filters, and compaction policies to optimize for specific performance targets. However, traditional tuning methods rely on "nominal" assumptions—perfect knowledge of the workload's read/write/query ratios. In dynamic cloud environments, these workloads are often unpredictable or "noisy," leading to significant performance degradation when actual traffic deviates from the initial guess.

Researchers at Boston University have addressed this gap by introducing ENDURE, a robust tuning framework designed to optimize LSM trees for a "neighborhood" of potential workloads rather than a single fixed point.

The K-LSM Unified Design Space

A prerequisite for robust tuning is a flexible architectural model. Traditionally, LSM designs are categorized as either Leveling (read-optimized) or Tiering (write-optimized). The authors propose K-LSM, a unified design space that parameterizes the maximum number of runs per level ($K_i$).

The K-LSM design space parameterizes the number of runs per level ($K_i$), bridging the gap between leveling and tiering.

By adjusting $K_i$, K-LSM can describe any configuration on the continuum between pure leveling and pure tiering. This encompasses hybrid designs like Dostoevsky or Lazy Leveling within a single mathematical framework, allowing the tuner to explore a much broader range of architectural possibilities.

The ENDURE Robust Tuning Framework

The core of the proposed solution is ENDURE, a paradigm that shifts the optimization goal from "best performance for a specific workload" to "best worst-case performance across a range of likely workloads."

Mathematical Formulation

ENDURE utilizes a set of design, system, and workload parameters to model performance. The notation used in this framework is summarized below:

Summary of design, system, and workload parameters used in the ENDURE framework.

Instead of solving for a single workload vector, ENDURE defines an "uncertainty region" around an expected workload using Kullback-Leibler (KL) divergence. It then formulates a robust optimization problem (a "min-max" problem) to find the configuration that minimizes the maximum cost across all workloads within that region. By deriving the mathematical dual of this problem, the authors enable optimal configurations to be found in less than a second using standard numerical solvers.

Experimental Evaluation and Key Insights

The authors evaluated ENDURE using a new "Uncertainty Benchmark" with 10,000 sampled workloads and empirical tests on RocksDB.

Performance Gains

  • Simulation Results: In large-scale simulations, ENDURE-tuned configurations provided up to 5x higher throughput than traditional nominal tunings when faced with uncertain workloads.
  • System Validation: On RocksDB, ENDURE achieved up to 2.4x throughput speedups and reduced I/O and latency by up to 90% during unexpected workload spikes.

Key Findings

  1. Robustness is a Tuning Property: A flexible design like K-LSM is not robust by default; it can actually perform worse if tuned too specifically for the wrong workload. Robustness emerges from the tuning process itself.
  2. Leveling's Resilience: The study found that leveling-based configurations generally exhibit greater robustness to workload perturbations than pure tiering.
  3. The Insurance Premium: Assuming high uncertainty (large $\rho$ in KL-divergence) introduces a slight "cost of pessimism"—a minor performance drop if the workload remains perfectly stable. However, this is outweighed by the massive gains in unstable scenarios.

Conclusion

ENDURE demonstrates that robust optimization can significantly enhance the reliability and performance of LSM-based storage systems in unpredictable environments. By leveraging the unified K-LSM design space and a dual-formulation solver, database administrators can protect systems against workload shifts with minimal computational overhead. Future work may extend this robust paradigm to other database tuning challenges, such as index selection and data partitioning.

Summary updated

BibTeX
@article{huynh2024towards,
  author = {Andy Huynh and Harshal A. Chaudhari and Evimaria Terzi and Manos Athanassoulis},
  title = {{Towards Flexibility and Robustness of LSM Trees}},
  journal = {VLDB J.},
  year = {2024},
  doi = {10.1007/s00778-023-00826-9},
}
Figure