EN
Back to the archive

The archive · Developer & Business Tools · Product decision · 2022–2026

Cozo bets Datalog plus relational algebra beats SQL and property graphs for graphs

CozoDB ships an embeddable Rust database that queries relational-graph data with Datalog; its 2022 Show HN drew 425 points and the repo now shows 4.1k stars.

CozoDB

The betThat connected data is best queried with Datalog over a relational model — composable and recursive where SQL and property graphs are not — and embedded like SQLite.Live

What the business is

CozoDB is an open-source, transactional database written in Rust that stores relational data and queries it with a Datalog dialect supporting recursion, aggregations, time travel and built-in graph algorithms, plus HNSW vector search inside Datalog since v0.6. It runs embedded in the host process or as a server, on desktop, mobile or in the browser through WASM, over storage backends from in-memory and SQLite to RocksDB and TiKV.

How it started

The author (HN handle zh217) had been building Cozo for about half a year when he posted the Show HN on 2022-11-08, because he wanted a graph database that was lightweight and easy to use like SQLite yet powerful and performant like Postgres and found none good enough. He judged Cypher little more expressive than SQL common-table-expressions, Gremlin not declarative enough, property-graph models over-constraining and triple stores slow, so he chose Datalog as the query language and relational algebra as the data model — his first significant project in Rust.

What happened

CozoDB grew language bindings for Python, NodeJS, Clojure, Go (through the C API), Rust and a standalone HTTP server, and the README advertised cross-platform support from phones to the browser. Version v0.6 added HNSW vector search integrated inside Datalog so vectors can be joined, unified and even recursed over like ordinary relations; v0.7 added MinHash-LSH near-duplicate search, full-text search and JSON value support. The README published performance numbers — roughly 100K queries per second on a mixed read/write OLTP workload over a 1.6M-row relation on a 2020 Mac Mini, two-hop graph traversal in under a millisecond on a 31M-edge graph — while the project stayed pre-1.0 and MPL-2.0 open source.

How it ended up

Still running as of the 2026-09-05 snapshot: the repository showed 4.1k stars, 164 forks and 1,813 commits, and the README still described CozoDB as young and pre-1.0; no funding round, company formation, acquisition, pivot or shutdown is disclosed in the material.

Background

CozoDB is an open-source, transactional database written in Rust that stores relational data and queries it with Datalog, a logic language whose recursion makes graph queries natural. It is embeddable like SQLite — running inside the host process, on a phone, or in the browser through WASM — but can also run as a server over RocksDB or TiKV storage for larger datasets, with bindings for Python, NodeJS, Clojure, Go and Rust.

The bet, laid out in the 2022-11-08 Show HN, was that connected data is best queried with Datalog over a relational model: the author argued SQL common-table-expressions are hard to compose, property-graph models like Neo4j are over-constraining, and triple stores carry performance problems, so he built Cozo around relational algebra plus recursion, time travel and canned graph algorithms.

CozoDB stayed an open, pre-1.0 project as it added features: v0.6 brought HNSW vector search inside Datalog, letting embeddings be joined and recursed over like any relation, and v0.7 added MinHash-LSH, full-text search and JSON values. As of the 2026-09-05 snapshot the repository showed 4.1k stars, 164 forks and 1,813 commits, with no funding, company formation or pivot disclosed.

What has to be true

  • Embeddability lets developers adopt Cozo like SQLite — no server to run — while RocksDB and TiKV backends answer the 'what about big data' objection.
  • Recursion in Datalog is far easier to express than recursive SQL, and it is the operation graph queries need most.
  • Relational algebra keeps the model composable: queries return relations that can be stored and reused, where property-graph and triple-store models force awkward round trips.
  • Adding vector search inside Datalog positioned the database for LLM-era workloads without adding a second query language.

What can be applied

Choose the substrate critics call old: Datalog plus relational algebra gave Cozo recursion and composability that SQL, property graphs and triple stores lack — the architecture is the pitch.

Aftermath

As of the 2026-09-05 snapshot CozoDB is still live and pre-1.0: the GitHub repository showed 4.1k stars, 164 forks and 1,813 commits, and the README still describes the project as very young, promising no syntax, API or storage compatibility before version 1.0. Bindings cover desktop, mobile and browser platforms, and the docs document HNSW vector search inside Datalog as of v0.6. No funding round, company formation, acquisition, pivot or shutdown is disclosed in the material.

Sources

spotted an error? The archive wants to know.

Your turn

You just read one. Describe what you are building, and see who is betting on the same thing.

Free account · 3 free questions · no card

Related cases