Automatic Storage Structure Selection for hybrid Workload

Hongzhi Wang, Yan Wei, Hao YanarXiv 2020

Abstract

Modern data applications increasingly demand Hybrid Transactional/Analytical Processing (HTAP), requiring systems to handle high-frequency writes and complex analytical queries simultaneously. This paper presents an automated system for selecting optimal storage engines and data layouts for HTAP workloads. By utilizing an XGBoost-based cost model and a novel column-clustering algorithm, the system dynamically adapts database structures to match shifting workloads without requiring manual intervention or deep internal knowledge of the underlying database engines.

Introduction

Traditionally, managing HTAP workloads requires data engineers to manually choose between row-oriented engines (optimized for transactions) and column-oriented engines (optimized for analytics). This often results in maintaining separate systems linked by brittle ETL (Extract, Transform, Load) pipelines, leading to three major pain points: data staleness due to ETL latency, a significant expertise gap required to tune database internals, and an inability to adapt to dynamic workloads where business needs shift over time.

System Architecture

The proposed solution centers on a "Storage Structure Selection Module" that acts as an intermediary between the application and the host database. This module treats the underlying database as a black box, allowing it to support diverse engines such as RocksDB (LSM-tree based) and WiredTiger (B+ tree based) interchangeably.

Figure 1: Overview of the Storage Structure Selection Module architecture.

As shown in the architecture diagram, the system consists of two primary loops. The first loop handles performance data collection and model learning, where a Benchmark Module generates data to train a cost model. The second loop focuses on storage structure recommendation, where workloads are analyzed to generate and evaluate candidate storage layouts.

Methods

Black-Box Cost Modeling and IO Surge Prediction

Instead of relying on hard-coded mathematical formulas, the system employs XGBoost to learn a cost model from features like row length, operation selectivity, and runtime metrics. A critical challenge in this modeling is the non-linear nature of database writes caused by internal buffers and background tasks like log flushing. To address this, the authors use a specific logistic regressor to predict the probability of "IO surges," enabling the model to estimate average performance more accurately despite inherent disk I/O jitter.

Flexible Storage Model Recommendation

To find the optimal balance between row and column storage, the system utilizes a "Flexible Storage Model" (FSM) derived through hierarchical clustering. Each column is represented as a vector based on its access frequency by specific queries. Columns that are frequently accessed together are physically grouped.

Figure 2: Comparison of storage models, including the Flexible Storage Model (FSM) in panel (d).

This approach allows the system to navigate the spectrum between the N-ary Storage Model (NSM, row-oriented) and the Decomposition Storage Model (DSM, column-oriented). By partitioning data horizontally, the system can apply a row-oriented structure to recent "hot" transactional data and a column-oriented or FSM structure to older "cold" data used for analytical reports.

Evaluation and Results

The system was evaluated using a custom benchmark for generalizability and the industry-standard TPC-H benchmark for realistic analytical scenarios. Key findings include:

  • High Prediction Accuracy: The learned cost model achieved a relative error of less than 10% for overall workload prediction.
  • Significant Speedups: Analytical workloads saw substantial performance gains when moving from default row-based layouts to recommended optimized structures.
  • Adaptability: The system successfully identified the superior model (DSM vs. NSM) based on the specific balance of transactions and analytics in the workload.

Conclusion and Future Work

While the system demonstrates high efficacy in selecting storage structures, several areas for future research remain. Current models evaluate queries in relative isolation and do not fully account for resource contention in highly concurrent environments. Additionally, the Flexible Storage Model can introduce storage redundancy, necessitating a more explicit accounting of "space cost" in future iterations. Finally, as hardware evolves, the model will need retraining to capture the unique latency profiles of technologies like non-volatile memory (NVM).

Summary updated

BibTeX
@misc{wang2020automatic,
  author = {Hongzhi Wang and Yan Wei and Hao Yan},
  title = {{Automatic Storage Structure Selection for hybrid Workload}},
  year = {2020},
  eprint = {2008.06640},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2008.06640},
}
Figure