FlowLog: Efficient and Extensible Datalog via Incrementality

Hangdong Zhao, Zhenghong Yu, Srinag Rao, Simon Frisk, Zhiwei Fan, Paraschos KoutrisarXiv 2025 · DOI

Abstract

FlowLog is a high-performance Datalog engine designed to overcome the limitations of existing systems by decoupling logical query optimization from physical execution. Built on Differential Dataflow (DD), FlowLog introduces a "robustness-first" optimization suite, including logic fusion and structural join planning. These techniques allow FlowLog to achieve state-of-the-art performance, outperforming established engines like Soufflé and DDlog by up to an order of magnitude while maintaining superior memory efficiency and scalability.

Introduction

Datalog is a powerful language for expressing recursive logic in domains like program analysis and graph processing. However, current engines often force a trade-off between performance and flexibility. High-performance engines like Soufflé are often "black boxes" that are difficult to extend with incremental updates. Conversely, modular systems built on traditional databases often suffer from high synchronization overhead. Furthermore, recursive workloads are notoriously volatile; traditional cost-based optimizers often fail because statistics for data generated during recursion are unavailable, leading to inefficient join orders and memory exhaustion.

System Architecture

FlowLog addresses these challenges by separating the relational Intermediate Representation (IR) from its physical execution on Differential Dataflow.

FlowLog System Architecture

As shown in the architecture diagram, the front end handles parsing and stratification, producing an IR. The optimizer then applies several Datalog-specific transformations before the DD Runtime executes the plan. This separation allows for modularity and the application of sophisticated optimization passes that are independent of the underlying execution engine.

Key Optimizations

FlowLog’s performance gains are driven by several core technical contributions:

Logic Fusion

In incremental dataflow systems, every operator must maintain state, which can lead to massive memory bloat. FlowLog implements Logic Fusion, which merges consecutive relational operators—such as Joins, Maps, and Filters—into single "Join-FlatMap" units.

Fused Join-FlatMap Operators

This fusion eliminates the need to materialize large intermediate results, significantly reducing the memory footprint and improving throughput compared to traditional un-fused plans.

Structural Optimizer and SIP

Because runtime statistics are unreliable in recursive contexts, FlowLog employs a Structural Optimizer. It uses a "Join Spanning Tree" (JST) model to minimize the number of variables in any single transformation, avoiding worst-case join scenarios. Additionally, Sideways Information Passing (SIP) uses semijoin pre-filtering to prune "dangling tuples" that do not contribute to the final result, saving expensive computation time.

Memory and Computation Efficiency

FlowLog further optimizes execution through Boolean Specialization, which uses single bits instead of 64-bit integers when only the existence of a fact matters. It also performs Subplan Sharing, automatically detecting and reusing identical sub-computations across different rules to eliminate redundant work.

Evaluation and Results

The authors evaluated FlowLog against a comprehensive benchmark suite including graph analytics (Reachability, SSSP), complex program analysis (DOOP, Polonius), and medical ontologies (Galen).

Key findings include:

  • Scalability: FlowLog was the fastest engine in 36 out of 41 tested cases at 64 threads.
  • Performance: It outperformed Soufflé by up to 11.7x and the baseline DDlog by 6.7x.
  • Memory Efficiency: Logic fusion and Boolean specialization resulted in FlowLog using approximately 3.5x less memory than DDlog.
  • Robustness: FlowLog successfully completed queries that caused other engines to time out, demonstrating the effectiveness of its structural optimizer and SIP techniques.

Conclusion

FlowLog demonstrates that a "robustness-first" approach to Datalog optimization can yield significant performance and scalability benefits. By prioritizing safe execution plans and minimizing memory overhead through operator fusion, FlowLog provides a robust foundation for large-scale, incremental recursive analysis.

Summary updated

BibTeX
@misc{zhao2025flowlog,
  author = {Hangdong Zhao and Zhenghong Yu and Srinag Rao and Simon Frisk and Zhiwei Fan and Paraschos Koutris},
  title = {{FlowLog: Efficient and Extensible Datalog via Incrementality}},
  year = {2025},
  eprint = {2511.00865},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.00865},
}
Figure