[Paper Review] Stubby: A Transformation-based Optimizer for MapReduce Workflows
Stubby is a transformation-based, cost-driven optimizer for MapReduce workflows that systematically explores a comprehensive plan space using plan-to-plan transformations to generate highly optimized workloads. It achieves up to 4.5x performance speedup by enabling vertical and horizontal packing, configuration tuning, and interface-agnostic optimization based on available metadata, making it effective across diverse workflow generation tools and data environments.
There is a growing trend of performing analysis on large datasets using workflows composed of MapReduce jobs connected through producer-consumer relationships based on data. This trend has spurred the development of a number of interfaces--ranging from program-based to query-based interfaces--for generating MapReduce workflows. Studies have shown that the gap in performance can be quite large between optimized and unoptimized workflows. However, automatic cost-based optimization of MapReduce workflows remains a challenge due to the multitude of interfaces, large size of the execution plan space, and the frequent unavailability of all types of information needed for optimization. We introduce a comprehensive plan space for MapReduce workflows generated by popular workflow generators. We then propose Stubby, a cost-based optimizer that searches selectively through the subspace of the full plan space that can be enumerated correctly and costed based on the information available in any given setting. Stubby enumerates the plan space based on plan-to-plan transformations and an efficient search algorithm. Stubby is designed to be extensible to new interfaces and new types of optimizations, which is a desirable feature given how rapidly MapReduce systems are evolving. Stubby's efficiency and effectiveness have been evaluated using representative workflows from many domains.
Motivation & Objective
- To address the challenge of automatic, cost-based optimization of MapReduce workflows due to the vast plan space, diverse interfaces, and incomplete metadata availability.
- To design a general-purpose optimizer that works across multiple workflow generation interfaces—such as programmatic APIs, Pig, Hive, and query languages—without requiring full information.
- To enable effective optimization even when key metadata (e.g., schema, filter conditions, partitioning) is missing by dynamically restricting the plan space to valid transformations.
- To support extensibility for new optimization types and interfaces, accommodating the rapid evolution of MapReduce systems.
- To demonstrate that transformation-based search over a comprehensive plan space can yield significant performance improvements over baseline workflows.
Proposed method
- Stubby constructs a comprehensive plan space for MapReduce workflows by modeling transformations such as vertical packing (merging map and reduce functions across producer-consumer jobs), horizontal packing (sharing I/O for same datasets), and configuration tuning (partitioning, compression, parallelism).
- It uses a transformation-based search strategy that generates new plans by applying atomic transformations to existing plans, enabling systematic exploration of the plan space.
- The optimizer employs a cost-based evaluation model that estimates execution cost using available metadata—such as filter conditions, schema annotations, and dataset statistics—while avoiding invalid transformations when information is missing.
- Stubby dynamically prunes the plan space by excluding transformations that require unavailable information (e.g., no vertical packing if schema annotations are missing), ensuring correctness and efficiency.
- It integrates an efficient search algorithm that prioritizes high-impact transformations and avoids exhaustive enumeration, focusing on near-optimal solutions.
- The system is designed as a middleware layer, operating independently of the underlying MapReduce engine and external to workflow generators, enabling broad compatibility.
Experimental results
Research questions
- RQ1Can a cost-based optimizer effectively explore a large, multi-dimensional plan space for MapReduce workflows while remaining efficient and correct under incomplete information?
- RQ2How can a transformation-based optimizer be designed to be extensible across diverse workflow generation interfaces (e.g., Pig, Hive, programmatic APIs) without requiring interface-specific logic?
- RQ3To what extent can vertical and horizontal packing transformations reduce I/O and execution time in real-world MapReduce workflows?
- RQ4How does the optimizer’s performance vary when key metadata (e.g., schema, filters) is missing or partially available?
- RQ5Can a general-purpose optimizer achieve significant performance improvements across diverse, real-world data analytics workloads?
Key findings
- Stubby achieved up to 4.5x speedup over baseline workflows in comprehensive experiments using representative workloads from diverse domains.
- The optimizer effectively prunes the plan space by excluding invalid transformations when metadata is missing, ensuring correctness without sacrificing performance.
- Vertical packing—merging map and reduce functions across jobs—was a major contributor to performance gains, especially in workflows with high shuffling overhead.
- Horizontal packing reduced redundant I/O for large datasets, particularly in workflows with multiple jobs processing the same input.
- The system demonstrated strong scalability and adaptability across different interfaces, including Pig, Hive, and programmatic APIs, without requiring reconfiguration.
- The cost-based transformation engine successfully identified near-optimal plans even in the absence of complete statistics, outperforming rule-based and limited-plan-space approaches.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.