Introduction
In the early 2010s, the Big Data ecosystem faced significant fragmentation. While MapReduce (Hadoop) served as the industry standard, its lack of native support for iteration made it inefficient for machine learning (ML) algorithms like Gradient Descent or PageRank. This led to the creation of specialized, "siloed" systems such as Pregel for graph processing and Spark for in-memory computation. However, this approach introduced substantial engineering overhead and a lack of logical optimization, as each system reinvented core components like scheduling and fault tolerance.
This paper proposes using Datalog, a declarative logic programming language, as a unified foundation for ML. By expressing ML tasks as recursive queries, the authors demonstrate that a general-purpose data-parallel engine can match or exceed the performance of specialized systems while offering superior programmability and database-style optimization.
Methods: A Declarative Foundation
The authors introduce a three-layer stack to bridge the gap between high-level ML algorithms and efficient physical execution.
- High-Level DSLs: Users express programs using familiar models like Pregel (vertex-centric) or Iterative Map-Reduce-Update (IMRU).
- Datalog Intermediate Representation: These programs are automatically translated into Datalog. Datalog is uniquely suited for ML because it treats recursion as a first-class citizen. To ensure mathematical soundness and termination, the authors employ XY-stratification.
- Optimized Physical Execution: The Datalog representation is compiled into an optimized physical query plan and executed on Hyracks, a partitioned-parallel runtime. This separation of logic and execution allows for database-style optimizations, such as selecting between B-Tree indices or flat file scans, without modifying the original ML code.
Experimental Evaluation
The system was evaluated using two large-scale datasets: the Yahoo! News Dataset (16.5 million records) for Batch Gradient Descent (BGD) and the 2002 Web Graph (1.4 billion vertices) for PageRank.
Key Results
The Datalog-based approach demonstrated significant advantages over existing frameworks:
- Cost-Effectiveness vs. Spark: In BGD tasks, the Hyracks-based Datalog engine proved more efficient. For an 80GB dataset, Hyracks reached peak cost-performance on just 10 machines. In contrast, Spark required at least 25 machines to handle the same workload due to its heavy reliance on in-memory processing.
- Performance vs. Hadoop: For PageRank, the system was an order of magnitude faster and cheaper than Hadoop. While Hadoop shuffles the entire graph across the network every iteration, the optimized Datalog plan maintains invariant data locally.
- Scalability: The system exhibited near-linear scaling; iteration times remained stable as dataset size and machine counts were increased proportionally.
Discussion and Future Work
The research highlights the power of physical independence in ML. By treating ML as recursive dataflows, decades of database research can be applied to modern AI challenges. Notably, the Hyracks system's ability to "spill to disk" allowed it to outperform Spark on smaller, more affordable clusters when data exceeded available RAM.
Current limitations include the manual nature of some DSL-to-Datalog translations and the complexity of optimizing arbitrary Datalog programs. Future work aims to automate these translations via higher-level languages like ScalOps and explore asynchronous execution models to further enhance performance.
Summary updated