🤖 AI Summary
This work addresses the high cost of maintaining consistency for materialized views in high-throughput and real-time scenarios, where existing systems offer limited SQL operator support or rely on manual tuning of refresh strategies. The paper proposes an end-to-end incremental materialized view maintenance engine that treats materialized views as first-class constructs within declarative data pipelines. Built on Apache Spark, the system features a modular and generalizable incremental refresh architecture capable of operating across heterogeneous data sources and query engines. It integrates a cost model, an automated refresh planner, and an execution optimizer to dynamically select optimal refresh strategies and enable cross-view batched co-optimization. Experimental evaluation demonstrates significant performance improvements, saving billions of CPU seconds daily across thousands of production pipelines.
📝 Abstract
Materialized views are a core construct in database systems, used to accelerate analytical queries and optimize batch pipelines for extract-transform-load (ETL) workflows. Maintaining view consistency as underlying data evolves is a fundamental challenge, especially in high-throughput and real-time settings. Incremental view maintenance (IVM) has been studied for decades and continues to attract significant investment from major database vendors. However, most industrial systems either offer limited SQL-operator coverage or require users to hand-tune refresh strategies.
This paper presents Enzyme, an IVM engine developed at Databricks to power Spark Declarative Pipelines. It provides a built-in, end-to-end approach to incremental pipelines, utilizing materialized views as first-class building blocks. By automating refresh planning, Enzyme reduces total cost of ownership and lets users focus on business logic rather than MV mechanics. Validation across thousands of large-scale production pipelines spanning diverse application domains has demonstrated substantial computational efficiency gains, yielding a cumulative daily compute reduction of billions of CPU seconds. Built atop Apache Spark primitives, Enzyme adds a cost-based optimization layer that selects refresh strategies for collections of materialized views organized into pipelines.
Enzyme's modular architecture is designed to generalize across data sources and query engines. We present key design decisions for incremental refresh planning and execution, including optimizations that exploit batching opportunities across materialized view sources. Experimental results on standard benchmarks demonstrate significant performance improvements at scale.