Velox A Universal Execution Engine for Modern Data and AI

Velox A Universal Execution Engine for Modern Data and AI

The execution framework within Velox uses non-blocking worker threads called drivers to ensure that CPU cycles are never wasted while waiting for slow storage input-output operations. This design choice stands at the heart of a broader effort to solve the chronic fragmentation that has historically plagued the big data and artificial intelligence sectors. For years, organizations have been forced to engineer entirely separate execution engines for every specific data task, ranging from interactive analytics to heavy batch processing and machine learning feature engineering. This environment is highly inefficient because it requires developers to constantly rebuild core primitives like aggregations, joins, and memory management for every new project. By offering a high-performance C++ library that functions as a universal engine block, Velox allows engineers to bypass this repetitive development cycle. It provides a modular foundation that can be integrated into existing systems, effectively bridging the gap between disparate platforms while ensuring that every hardware optimization or bug fix benefits the entire ecosystem simultaneously. This standardization is transforming how large-scale data platforms are built and maintained.

Historical Context and Technical Motivation

The Evolution: From Presto to Velox

The narrative of Velox began at Meta during the early 2010s, a period marked by the rapid expansion of one of the world’s most sophisticated data infrastructures. At the center of this ecosystem was Presto, a distributed SQL query engine designed to facilitate fast analytics over massive datasets. While Presto successfully enabled thousands of engineers to query petabytes of data, its architecture was tied to the Java Virtual Machine, which eventually created a performance ceiling as data volumes reached an unprecedented scale. The inherent limitations of managed languages, particularly regarding memory management and CPU utilization, became increasingly apparent as the hardware landscape evolved. Engineers realized that maintaining the status quo would lead to unsustainable infrastructure growth, necessitating a move toward a more efficient, native execution model that could handle the demands of 2026 and beyond.

The transition toward a native C++ engine was initially conceived as a specialized project to enhance Presto, but it quickly transformed into a much larger ambition. During the development of what was then known as Prestissimo, researchers identified that the underlying components—such as vectorized execution paths, complex hash tables, and columnar memory structures—were not unique to SQL analytics. These same building blocks were essential for Apache Spark, stream processing frameworks, and the pipelines feeding machine learning models. By extracting these common primitives into a standalone library rather than siloing them within a single application, the engineering team created Velox. This pivot from a specific application to a universal library allowed for a unified development effort, ensuring that any improvement in the core engine would immediately propagate across every supported data processing workload in the organization.

Overcoming Java Virtual Machine Limits

Relying on the Java Virtual Machine for heavy analytical workloads has traditionally introduced several significant performance bottlenecks that are difficult to mitigate. One of the primary issues is the unpredictability of garbage collection, which can cause erratic query latency and intermittent pauses during high-load scenarios. Furthermore, the abstraction layers of the JVM often prevent software from fully exploiting modern CPU features, such as Single Instruction, Multiple Data instructions. These hardware capabilities are crucial for processing multiple data points in a single clock cycle, which is a requirement for modern vectorized execution. Without the ability to precisely control memory layout and instruction scheduling, even the most optimized Java code struggles to match the raw throughput of a native implementation designed specifically for columnar data processing.

In contrast, the move to a C++ foundation through Velox provides developers with the surgical precision required to maximize hardware efficiency. Native code allows for the implementation of advanced memory management techniques, such as custom memory arenas and manual allocation, which are essential to preventing the overhead of frequent allocations and deallocations. This level of control is particularly important when handling “spill-to-disk” operations, where temporary data must be efficiently moved between RAM and storage during massive joins or sorts. By bypassing the managed environment of the JVM, Velox can achieve a much tighter integration with the underlying hardware, delivering a consistent and predictable performance profile. This shift has enabled a new era of data processing where software is no longer a bottleneck for hardware, allowing more ambitious analytical and AI applications to be deployed on more streamlined infrastructure.

Architectural Foundations and Modularity

Integration: The Execution Layers

Velox’s architecture is strictly modular, allowing it to function as a library that integrates seamlessly into various host systems. In this framework, the host system—whether Presto, Spark, or a custom machine learning platform—serves as the “brain” that manages high-level tasks such as SQL parsing, logical planning, and cluster-wide scheduling. Once the host generates a physical plan, it hands off specific fragments to Velox for execution. This separation of concerns ensures that Velox does not need to reinvent the complex logic required for distributed coordination or metadata management. Instead, it focuses entirely on local plan execution, providing a highly optimized data plane that any system capable of communicating through its defined interfaces can utilize.

Within the execution layer, Velox organizes its operations through a sophisticated hierarchy of tasks and pipelines. A single execution task is broken down into multiple pipelines, each representing a linear sequence of operators such as table scans, filters, and aggregations. These pipelines are processed by non-blocking worker threads, or Drivers, which move batches of data through the system in a streaming fashion. This design is highly effective at hiding latency because it allows the system to switch between different query fragments whenever a specific operation is stalled by storage or network I/O. By maintaining a high degree of concurrency without the overhead of heavy operating system threads, Velox ensures that available CPU resources are utilized to their fullest extent, providing a highly responsive environment for both batch and interactive workloads.

Data: Structures and Resource Management

At the core of the library lies a sophisticated columnar memory representation known as vectors. These structures are designed to keep data packed tightly in memory, which facilitates the use of SIMD instructions and minimizes the frequency of cache misses. Velox supports several specialized vector types to optimize for different data patterns, such as FlatVectors for contiguous data and DictionaryVectors for compressed or repetitive information. This flexibility allows the engine to perform “zero-copy” operations, where data can be reshaped or filtered without the need for expensive memory movement. By keeping data in its most efficient form for as long as possible, the engine dramatically reduces the energy and time required to process complex datasets, making it an ideal choice for the resource-intensive environments of 2026.

Resource management is handled with equal precision through a hierarchical system of memory pools. Every byte of RAM consumed by a query is tracked through these pools, allowing for strict enforcement of memory limits and preventing the out-of-memory errors that often crash large-scale analytics clusters. If a query begins to exceed its allocated capacity, a reclaimer system is triggered to identify temporary data that can be safely moved to disk. This process, known as spilling, ensures that even the largest and most complex queries can eventually complete successfully, albeit at a slower speed, rather than failing entirely. This level of stability and predictability is essential for enterprise-grade data platforms where reliability is just as important as performance, ensuring that critical reports and AI models are delivered on time regardless of the system’s current load.

Operational Efficiency and Lifecycle

Query: Execution and Resource Management

The lifecycle of a query within the Velox ecosystem is characterized by a high degree of automation and efficiency. When a query fragment is received from the host, the engine immediately begins mapping that plan to its internal execution structures. This involves optimizing expression evaluation paths, where complex SQL math and string operations are compiled into fast execution loops. The system uses a vectorized approach for these expressions, processing batches of data rather than individual rows. This method significantly reduces function call overhead and allows the CPU to maintain a steady flow of instructions, which is critical for achieving the high throughput required in modern data engineering. By focusing on batch-level efficiency, the engine can handle millions of operations per second while maintaining low per-row processing costs.

Resource arbitration plays a vital role during the active execution of these query pipelines. As drivers stream data through the operators, the system constantly monitors the availability of memory and CPU cycles. In multi-tenant environments where many queries are running simultaneously, this monitoring allows the engine to fairly distribute resources and prevent a single heavy query from monopolizing the system. Furthermore, the engine utilizes asynchronous data caching to ensure that frequently accessed information is always ready for processing. This preemptive approach to data management significantly reduces the time that worker threads spend idling, creating a highly efficient loop of data ingestion, transformation, and output. The result is a streamlined operational flow that can scale effortlessly from small, interactive queries to massive, long-running batch jobs.

Storage: Format and Cloud Integration

Velox is designed to operate in a diverse storage landscape, offering native support for a wide range of industry-standard data formats and storage backends. The library includes highly optimized readers for columnar formats like Parquet and ORC, which are the standard for modern data warehouses. These readers are specifically engineered to support “filter pushdown” and “column pruning,” techniques that allow the engine to ignore irrelevant data before it even reaches the CPU. By reading only the specific columns and rows needed for a query, Velox minimizes the amount of data transferred from storage, which is often the most significant bottleneck in cloud environments. This efficiency is particularly valuable when working with remote object stores where network bandwidth can be expensive and limited.

In addition to traditional file formats, the library provides deep integration with modern table formats such as Apache Iceberg and Delta Lake. These formats add a layer of transactional consistency and metadata management on top of raw files, enabling features like time travel and schema evolution. Velox’s ability to interact directly with these systems ensures that it can serve as the execution engine for the next generation of data lakes and “lakehouses.” Furthermore, the engine’s connectivity extends to cloud-native storage solutions, including AWS S3 and Google Cloud Storage, through optimized adapters that handle the intricacies of remote authentication and multipart transfers. This broad compatibility ensures that organizations can deploy Velox-powered systems across any infrastructure without worrying about the underlying storage technology, providing a truly universal foundation for data access.

Ecosystem Impact and Performance

Integration: Modern Data Frameworks

The impact of Velox is most evident in its rapid adoption across a wide range of popular data frameworks. One of the most notable implementations is through the Apache Gluten project, which provides a bridge between the high-level management features of Apache Spark and the high-performance execution of Velox. By using Gluten, organizations can maintain their existing Spark infrastructure and development workflows while offloading the most compute-intensive tasks—such as joins and aggregations—to the Velox C++ backend. This hybrid approach allows for a significant boost in performance without the need for a costly and risky migration to an entirely new platform. It effectively grants Spark the speed of a native database while maintaining its flexibility as a general-purpose compute framework.

Beyond Spark, Velox also plays a critical role in unifying the worlds of data engineering and artificial intelligence. Historically, these two domains have used different tools and libraries, leading to significant friction when moving data from a warehouse into a machine-learning pipeline. Velox addresses this by serving as the backend for frameworks like TorchArrow, a Python DataFrame library designed for PyTorch. This allows machine-learning engineers to use the same high-performance execution engine for feature engineering that data engineers use for SQL analytics. This synthesis reduces the complexity of AI development and ensures that data remains consistent as it moves through the different stages of the model life cycle. By providing a shared language for data execution, Velox is helping to break down the silos between these traditionally separate engineering disciplines.

Benchmarking: Evidence of Performance

The performance improvements provided by Velox are transformative, as demonstrated by extensive benchmarking in real-world production environments. In internal testing conducted at Meta using the TPC-H suite, Velox-powered workers delivered impressive results compared to traditional Java-based stacks. For instance, some queries saw speedups of over 8x, while others improved by nearly 10x in terms of wall-clock time. More importantly, these efficiencies translated directly into tangible infrastructure savings. By deploying Velox, the organization was able to support the same production workloads using significantly fewer servers, leading to a reduction in both data center footprint and energy consumption. This economic advantage is a primary driver for its adoption, as it allows companies to scale their data operations more sustainably.

Looking ahead, the integration of GPU acceleration through libraries like NVIDIA’s cuDF is poised to push these performance gains even further. Early benchmarks have shown that shifting specific query plan fragments to advanced hardware like the Grace Hopper Superchip can result in speedups of up to 12x compared to high-end CPUs. This capability ensures that the library is prepared for the increasingly demanding computational needs of 2026 and the years to come. Furthermore, cloud-based benchmarks on platforms like AWS EKS have shown that Velox-accelerated systems consistently outperform native SQL engines while utilizing less peak memory. These results prove that the engine is not just an incremental improvement but a fundamental leap forward in execution efficiency that can handle the most complex and data-intensive challenges currently facing the industry.

Strategic Path for Data Architecture

Transforming: Data Infrastructure Standards

The industry successfully transitioned toward a modular execution model, marking a significant departure from the siloed development practices of the past. By decoupling the execution engine from the higher-level management layers of the database stack, architects were able to focus their innovation efforts where they mattered most. This shift fostered a “Lego-like” flexibility that allowed for the rapid assembly of specialized tools from a common set of high-performance building blocks. The adoption of a universal library effectively standardized the semantics of data processing, ensuring that a calculation performed in an analytics tool would yield the exact same result when executed in a machine learning pipeline. This consistency was instrumental in rebuilding trust in data across large organizations, where subtle differences in engine behavior had previously caused significant operational friction.

As a direct result of these advancements, the focus of data engineering moved from building core infrastructure to delivering high-value insights and AI-driven applications. Organizations that embraced this universal engine block were able to reduce their total cost of ownership for data platforms while simultaneously increasing their agility in responding to new business requirements. The open-source nature of the project ensured that these benefits were democratized, allowing even smaller teams to leverage the same world-class performance once reserved for the world’s largest technology companies. This movement toward shared, standardized infrastructure has laid the groundwork for a more efficient and collaborative future in data science, proving that the most complex technical challenges are best solved through a unified approach to engineering and resource utilization.

Insights: Next Steps for Implementation

For technical leaders and architects looking to modernize their data stack, the primary recommendation is to evaluate where execution bottlenecks exist within their current JVM-based or fragmented systems. Identifying the specific workloads that would benefit most from native C++ execution is a crucial first step in a phased migration strategy. By integrating Velox-powered components like Apache Gluten into Spark clusters or adopting Prestissimo for interactive SQL, teams can achieve immediate performance gains without disrupting established workflows. It is also advisable to invest in training for engineering teams to understand the nuances of columnar data structures and vectorized execution, as this knowledge is essential for optimizing custom operators or integrating new storage formats. This proactive approach ensures that the organization is well-positioned to capitalize on the ongoing evolution of the data ecosystem.

Looking ahead, decision-makers should prioritize the adoption of standardized data formats like Iceberg and Parquet to ensure seamless compatibility with the Velox execution engine. These formats provide the necessary metadata and physical layout to fully exploit the library’s vectorized reading and filtering capabilities. Additionally, staying informed about the progress of GPU acceleration within the Velox framework will allow organizations to prepare their infrastructure for the next wave of computational demands. By aligning current development efforts with the modular and hardware-agnostic philosophy of this universal engine, businesses can ensure that their data platforms remain resilient, scalable, and cost-effective. The transition to this unified model is not merely a technical upgrade but a strategic investment in the future of high-performance computing and artificial intelligence.

Subscribe to our weekly news digest.

Join now and become a part of our fast-growing community.

Invalid Email Address
Thanks for Subscribing!
We'll be sending you our best soon!
Something went wrong, please try again later