Recursive SQL is where good intentions go to die. A single WITH RECURSIVE walk over a dependency graph turns into cycle guards, materialisation hints, and a query planner that quietly gives up somewhere around depth forty. Datalog engines exist because that problem is not a query problem — it is a language problem, and declarative rules solve it better than recursive CTEs ever will.

The catch is that “Datalog engine” covers three completely different machines: a compiler that turns rules into a native program, a streaming dataflow system that recomputes answers incrementally, and an embedded database that you link into your own application. Choosing the wrong one costs weeks.

TL;DR: Pick Soufflé when your Datalog is a build step and you want a fast binary. Pick CozoDB when Datalog needs to live inside your application with storage and transactions. Pick Differential Datalog only if you are already invested in DDlog or genuinely need incremental recomputation — VMware’s last upstream commit on the main repository landed in July 2023, so treat it as research-grade code you will maintain yourself. All three are open source, none of them require a cloud account, and you can run the first useful query in under fifteen minutes.

The Three Engines Side by Side

Every number below was pulled from the upstream repositories on 13 October 2026 with the GitHub CLI, so you can verify any row yourself.

DimensionSouffléDifferential DatalogCozoDB
Execution modelRules compiled into a parallel C++ program (plus an interpreter path)Rules compiled into Rust with differential dataflow underneathEmbedded query engine, also usable as a standalone server
Upstream stars1,1841,5014,135
Last upstream commit2026-10-022023-07-072024-12-04
LicenseUPL-1.0MITMPL-2.0
PersistenceFlexible I/O system, including SQLite3 interfacesInput/output relations, in-memory by defaultBuilt-in disk-backed storage engine with transactions
Incremental updatesRe-run the program (batch)Yes — this is the whole pointYes, via transactional writes
Runs in a browserNoNoYes, official WebAssembly build
Best atStatic analysis, program analysis passes, whole-program rulesLong-lived derivations over changing input streamsApplication-embedded graph, relational and recursive queries

Decision Matrix: Pick One in Ten Seconds

Your situationPickWhy
You analyse source code, bytecode, or link graphs at build timeSouffléIt synthesises a parallel C++ program from your rules; the output is a binary you can ship
You need Datalog as a library inside a service, with storageCozoDBStorage, transactions and bindings are part of the product, not an afterthought
Facts arrive continuously and answers must stay freshDifferential DatalogIncremental recomputation is its execution model, not a cache layer
You need the most actively maintained option in October 2026Soufflé or CozoDBBoth saw commits in 2026; DDlog’s last commit was in 2023
You want to try Datalog before installing anythingCozoDBThe official WebAssembly demo runs a complete instance in the browser
You already have a working DDlog programDifferential DatalogMigration to a new engine is more expensive than maintaining what works

Soufflé: Compile the Rules, Ship a Binary

Soufflé is a variant of Datalog designed for tool builders — its own README describes it as a language “for tool designers crafting analyses in Horn clauses” that synthesises a native parallel C++ program from a logic specification. That single design decision explains everything else about it.

  • Depth of language features. Recursively defined record types (constructors) for tuples, a component model for large specifications, subsumption, aggregation, user-defined functors, a choice construct, and an extended I/O system that can read and write relations through SQLite3.
  • Analysis tooling that production compilers need. Provenance and debugging support, plus profiling tools — the things you reach for when a ruleset is correct but mysteriously slow.
  • A real interpreter path too. The project has also published work on efficient interpretation through de-specialisation, so you are not forced into a compile step for every experiment.
  • Actively developed. Last upstream commit 2026-10-02, 1,184 stars, UPL-1.0 licence, and releases packaged for Ubuntu, Fedora and Oracle Linux.

The trade-off is architectural: a compiled program is wonderful in CI and awkward in a long-running service that receives new facts every second. Re-running the whole analysis is the update path, and that is fine for a compiler backend and painful for a stream processor.

Differential Datalog: Incremental Derivation, Frozen Upstream

DDlog (the repository is vmware/differential-datalog) takes the opposite bet. It is a programming language for incremental computation, explicitly suited to “writing programs that continuously update their output in response to input changes”. Under the hood it compiles your rules into Rust on top of differential dataflow.

When it fits, nothing else in this comparison comes close. Change one edge in a million-row graph and DDlog repairs the affected derivations instead of recomputing the closure. That is a genuinely different cost curve, and it is why the project still has 1,501 stars long after development slowed down.

The honest problem is maintenance. The last upstream commit was 2023-07-07. There is no 2026 activity, no security process you can point at, and a growing pile of Rust and JDK versions between you and a clean build. The build path is also heavier than the other two: the README lists default-jdk, libc6-dev and libgmp-dev as system dependencies, plus the Haskell stack toolchain and Rust 1.52.1 or later.

DDlog profiling output from the upstream repository

Treat DDlog as a research-grade dependency: excellent ideas, MIT licensed, and entirely your problem once you adopt it.

CozoDB: Datalog With a Storage Engine

CozoDB is the pragmatic middle. Its own description is blunt about what it is — a transactional, relational-graph-vector database that uses Datalog for query. Where Soufflé is a compiler and DDlog is a dataflow runtime, CozoDB is a database: storage, transactions, indexes, and a query language you talk to.

Three details make it the easiest of the three to adopt:

  1. You can evaluate it in a browser. The project deliberately duplicates a full instance into WebAssembly: the README points readers at the WebAssembly demo and notes you can run “a complete CozoDB instance in your browser, at near-native speed for most operations”. No install to find out whether you like the language.
  2. Installation follows your environment, not the project’s preference. The README ships an install table mapping each language and environment to official platform support and storage options, and the documentation site covers the per-language path.
  3. Popularity meets the definition of “boring”. 4,135 stars on a Datalog database is unusual and useful: more eyes, more bindings, more Stack Overflow answers.

The caveat is momentum. The last upstream commit is 2024-12-04, so CozoDB in 2026 is a stable-but-quiet project. It is not abandoned in the sense of being broken — it is abandoned in the sense that nobody is shipping fixes right now. If you can live with that, it is the best embeddable Datalog engine available; if you cannot, budget for reading the source.

Transitive Closure in All Three Languages

The canonical Datalog benchmark is reachability. Here is the same program written for each engine, using each project’s own syntax.

Soufflé (save as reachable.dl):

1
2
3
4
5
6
7
.decl edge(src: symbol, dst: symbol)
.decl reachable(src: symbol, dst: symbol)

reachable(x, y) :- edge(x, y).
reachable(x, y) :- reachable(x, z), edge(z, y).

.output reachable

Differential Datalog (save as reachable.dl):

1
2
3
4
5
6
7
relation edge(src: string, dst: string)
relation reachable(src: string, dst: string)

reachable(x, y) :- edge(x, y).
reachable(x, y) :- reachable(x, z), edge(z, y).

output reachable

CozoDB (run in the interactive console or the browser demo):

1
2
?[src, dst] := *edge[src, dst]
?[src, dst] := ?[src, mid], *edge[mid, dst]

The rules are almost identical — that is the point of Datalog — but what happens after you press enter is completely different. Soufflé generates and compiles C++, DDlog builds an incremental dataflow graph, and CozoDB plans the query against stored relations.

Installing Each Engine, Commands Straight From Upstream

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 1) Soufflé — packaged builds exist for Ubuntu, Fedora and Oracle Linux
#    https://github.com/souffle-lang/souffle/releases
git clone https://github.com/souffle-lang/souffle.git
#    Build steps live at https://souffle-lang.github.io/build

# 2) Differential Datalog — dependencies per the upstream README
apt install default-jdk libc6-dev libgmp-dev
wget -qO- https://get.haskellstack.org/ | sh          # Haskell stack
curl https://sh.rustup.rs -sSf | sh                   # Rust toolchain
#    Then unpack the binary release and wire up the environment:
export DDLOG_HOME=/opt/ddlog
export PATH="$DDLOG_HOME/bin:$PATH"

# 3) CozoDB — no install required to evaluate it
#    Run a full instance in the browser: https://www.cozodb.org/wasm-demo/
#    Then follow https://docs.cozodb.org for your language or environment

If you only remember one line from this section, remember the third: you can judge CozoDB’s query language in a browser tab before you touch a package manager.

How to Benchmark Logic Engines Without Fooling Yourself

Published Datalog comparisons age badly because the interesting workloads are rarely public. Build your own three-case harness instead:

  1. A large, sparse graph. One million edges across a few hundred thousand nodes, with a few surprisingly deep chains. This measures closure efficiency.
  2. A highly recursive ruleset. Not just reachability — add a second and third recursive relation so the fixed-point must iterate more than twice.
  3. An incremental update pattern. Insert ten edges, then re-run. This is the only test that separates DDlog’s design from the two batch-oriented engines.

Run each case at least three times and keep the fastest wall-clock number, because first runs include cold caches and JIT warm-up. On Linux, /usr/bin/time -v gives you both elapsed time and peak resident memory, and peak memory is often the number that decides whether the engine fits your CI runner.

One expectation to set now: a compiled engine usually wins the cold batch case, while an incremental engine wins when the input barely changes. If your workload is “recompute everything nightly”, incremental machinery is pure overhead.

Operational Pitfalls and Migration Notes

  • Legacy Soufflé code is not silently compatible. Older specifications need either the --legacy command-line flag or a .pragma "legacy" line at the top of the source file. Both are documented upstream.
  • DDlog’s dependency surface is the migration risk, not the language. JDK, GMP headers, Haskell stack and a specific Rust floor. Pin all four in your build image or your next laptop rebuild will fail.
  • A quiet repository is a real cost. With CozoDB’s last upstream commit in December 2024 and DDlog’s in July 2023, assume you are the maintainer of your fork. Check the issue tracker before you depend on a feature.
  • Set semantics bite people coming from SQL. Datalog relations are sets; duplicates do not exist, and aggregation semantics differ from GROUP BY. If you need row counts, model them explicitly.
  • Do not expect SQL’s planner knobs. There are no index hints, no EXPLAIN ANALYZE habit that transfers cleanly, and no query cache to tune. Soufflé instead gives you profiling and provenance; CozoDB gives you storage-level planning.
  • Migration is mostly mechanical, which is exactly why it is dangerous. Rewriting rules takes an afternoon; re-validating semantics against your old results takes longer. Diff outputs on a real dataset before you delete the old pipeline.

If your ruleset is really an ontology problem rather than a graph problem, the same reasoning applies one layer up — see our comparison of knowledge graph databases like TypeDB, Jena and Virtuoso and the Clojure Datalog databases XTDB, Datahike and DataLevin. And if you mainly want rules that terminate with a proof, the Prolog engines comparison covers SWI-Prolog, Scryer and Trealla instead.

FAQ

Is Datalog a database or a programming language? It is a declarative query language with set semantics, and it can be either. Soufflé treats it as a language you compile into a native program for analysis tasks. CozoDB treats it as the query language of a transactional database. Differential Datalog treats it as a specification for an incremental computation. The syntax is similar in all three; the runtime contract is not.

Which of the three is fastest? For a cold, whole-database batch job, a compiled engine such as Soufflé usually wins because your rules become a parallel native program. For repeated runs where only a few facts change, Differential Datalog’s incremental model can be dramatically cheaper because it repairs derivations instead of recomputing them. The honest answer is that benchmark results depend on your rules, so run the three-case harness above on your own data before deciding.

Do I need to install anything to try CozoDB? No. The project publishes an official WebAssembly build and the README directs new users to run a complete instance in the browser before installing. That is the fastest way to decide whether you like Datalog’s semantics, and it costs nothing.

Is Differential Datalog abandoned? Development on the main vmware/differential-datalog repository stopped after a commit on 7 July 2023. The code remains MIT licensed and the ideas remain excellent, but you should plan to maintain it yourself — including pinning its JDK, GMP, Haskell and Rust dependencies.

Can I embed Soufflé in a long-running service? Not comfortably. Soufflé’s strength is synthesising a native parallel program from your rules, which makes it a build-time tool. If you need a Datalog engine living inside a process that receives new facts continuously, an embeddable database such as CozoDB or an incremental engine such as DDlog is the better fit.

Which one should a small team pick in 2026? Start with Soufflé if your problem is analysis shaped, and CozoDB if your problem is application shaped. Soufflé saw upstream commits in October 2026 and CozoDB is the most starred of the three at 4,135 stars, but only Soufflé is actively receiving commits right now — that difference matters more than any micro-benchmark for a team that cannot maintain a fork.


💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com