TL;DR
Managing diverse cloud data infrastructures is complex and costly. This paper introduces BRAD, a system that automates the design and optimization of these infrastructures by treating it as a "blueprint planning" problem. BRAD uses learned models to predict performance and cost, enabling it to find cost-effective configurations that meet user-defined performance targets, outperforming existing solutions by up to 13x.
What Problem Does This Paper Address?
Organizations increasingly rely on a variety of specialized cloud database engines (e.g., Aurora for transactions, BigQuery for analytics, Snowflake for data warehousing) to handle diverse data workloads. However, designing and managing these multi-engine infrastructures is a significant challenge. Data engineers must make complex decisions about engine selection, data partitioning, provisioning, and query routing, which are often non-obvious and highly dependent on specific workloads. Current software abstractions also tightly couple applications to specific engines, making changes difficult. This complexity leads to suboptimal performance, inflated costs, and a heavy burden on engineering teams. The paper aims to automate this process, allowing users to declaratively specify their needs and have an intelligent system design and manage the underlying infrastructure.
Methods
The core of BRAD's approach is blueprint planning, a framework for virtualizing and automating cloud data infrastructure design. A "blueprint" is a comprehensive plan that defines:
- The set of engines to use.
- Their provisioning configurations (instance types, node counts).
- Data placement across engines.
- A query routing policy.
BRAD uses a cost-based optimization approach to find the best blueprint. This involves:
- Blueprint Scoring: Estimating the utility of a candidate blueprint. This is done using a vector score comprising workload performance (predicted query/transaction latencies), operating cost, and transition costs.
- Query Run Time Prediction: A novel Graph Neural Network (GNN) is used to predict query run times based solely on logical query features (SQL text, join templates, selectivities) and dataset statistics, avoiding the need for physical execution plans. Analytical models based on Amdahl's Law and queuing theory adjust these predictions for different provisionings and system loads.
- Transaction Latency Prediction: An analytical model is used, assuming an uncontended OLTP workload.
- Operating Cost & Transition Cost: Models estimate cloud provider costs and the time/cost to switch between blueprints.
- Blueprint Search: A greedy beam-based search algorithm systematically explores the vast design space of possible blueprints. It incrementally builds candidate blueprints by considering queries one by one and maintaining a set of top-k promising solutions.
BRAD also includes mechanisms for query routing (using a decision forest for fast, online routing) and model bootstrapping (learning from observed workload data).
Datasets
- IMDB dataset [63]: Adapted and expanded to 160 GB for evaluation. Synthetic tables were added to model transactional needs.
- Synthetic Workload: Designed to mimic a movie theater company's data processing needs, including transactions and diverse analytical queries. This workload is described as a new benchmark to address limitations of existing ones.
Key Insights and Ideas
- Infrastructure Design as Optimization: The paper frames the complex task of cloud data infrastructure design as a solvable optimization problem, analogous to query planning.
- Blueprints as a Unified Design Space: The concept of a "blueprint" provides a holistic representation of infrastructure design, encompassing engines, provisioning, data placement, and routing.
- Logical Query Features for Prediction: Leveraging only logical query features for performance prediction is crucial for BRAD's ability to plan infrastructure even for engines that are not yet provisioned or loaded with data.
- Separation of Concerns: BRAD separates the complex, offline blueprint planning from the fast, online query routing, enabling efficient decision-making.
- Adaptability to Workload Shifts: BRAD's ability to re-optimize and transition to new blueprints allows it to adapt to changing workloads and user constraints, a key advantage over static configurations.
Key Results
- Cost Savings: BRAD achieved 1.6x to 13x cost savings compared to serverless auto-scaling or HTAP systems across various scenarios. For example, it achieved 6.0x savings over its initial provisioning and 4.6x over System H in one scenario.
- Performance Targets Met: BRAD consistently met user-defined performance targets (e.g., p90 transaction latency under 30ms, p90 analytics latency under 30s).
- Model Accuracy: The scoring models demonstrated sufficient accuracy for effective blueprint planning, with median Q errors generally below 2.0 for query run time and data scanned.
- Generalizability: The predictive models showed good generalization to unseen join templates, added tables, and increased dataset sizes.
- Robustness to Prediction Errors: The blueprint planner was robust to prediction errors, with significant changes in blueprint selection only occurring when over 40% of predictions had errors exceeding ±50%.
- Query Routing Efficiency: BRAD's query routing achieved a geomean slowdown of 1.31x, comparable to using its run time model but without the inference overhead.
Limitations and Future Work
- SQL Dialect Translation: BRAD currently assumes engines can correctly execute queries and relies on keyword matching for specialized functionality. Future work could explore SQL dialect translation techniques to expand engine eligibility.
- Model Generalization: While models generalize well, they might struggle with queries significantly different from training data. The paper suggests that BRAD can update its models with newly observed data over time.
- Transaction Model Simplification: The transaction latency model assumes an uncontended OLTP workload. More complex transactional scenarios might require more sophisticated modeling.
- Engine Support: BRAD currently supports Aurora, Redshift, and Athena. Extending support to other relational databases with SQL interfaces and deterministic costs is a potential future direction.
- Bootstrapping Phase: BRAD requires an initial bootstrapping phase to learn from observed workloads. The paper suggests that fully transferable performance models would be ideal but are left for future work.
Summary updated