---
title: "datalevin"
type: "tool"
slug: "datalevin-datalevin"
canonical_url: "https://www.graphcanon.com/tools/datalevin-datalevin"
github_url: "https://github.com/datalevin/datalevin"
homepage_url: "https://github.com/datalevin/datalevin"
stars: 1437
forks: 82
primary_language: "Clojure"
license: "EPL-2.0"
categories: ["developer-tools"]
tags: ["embedded-database", "graph-database", "vector-databases", "ai-native", "key-value-store", "document-database", "fulltext-search", "client-server-database"]
updated_at: "2026-07-07T18:46:44.043535+00:00"
---

# datalevin

> A simple, fast and versatile Datalog database

Datalevin is a durable Datalog database designed to provide a simple and efficient query engine for developers.

## Facts

- Repository: https://github.com/datalevin/datalevin
- Homepage: https://github.com/datalevin/datalevin
- Stars: 1,437 · Forks: 82 · Open issues: 26 · Watchers: 24
- Primary language: Clojure
- License: EPL-2.0
- Last pushed: 2026-07-07T16:22:03+00:00

## Categories

- [Developer Tools](/categories/developer-tools.md)

## Tags

embedded-database, graph-database, vector-databases, ai-native, key-value-store, document-database, fulltext-search, client-server-database

## Related tools

- [ECC](/tools/affaan-m-ecc.md) - The agent harness performance optimization system (★ 226,962)
- [AutoGPT](/tools/significant-gravitas-autogpt.md) - AutoGPT: Build, Deploy, and Run AI Agents (★ 185,417)
- [prompts.chat](/tools/f-prompts-chat.md) - The world's largest open-source prompt library for AI (★ 165,019)
- [JavaGuide](/tools/snailclimb-javaguide.md) - Snailclimb/JavaGuide: 面试 & 后端通用面试指南，覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发 (★ 156,863)
- [browser-use](/tools/browser-use-browser-use.md) - 🌐 Make websites accessible for AI agents. Automate tasks online with ease. (★ 103,315)
- [caveman](/tools/juliusbrussee-caveman.md) - Cuts 65% of tokens in AI coding agent responses. (★ 86,150)
- [llm-course](/tools/mlabonne-llm-course.md) - Course to get into Large Language Models (LLMs) with roadmaps and Colab notebooks. (★ 80,726)
- [OpenHands](/tools/openhands-openhands.md) - The self-hosted developer control center for coding agents and automations. (★ 79,805)

## README (excerpt)

```text
<p align="center"><img src="logo.png" alt="datalevin logo"
height="140"></img></p>
<h1 align="center">Datalevin</h1>
<p align="center"> 🧘 Simple, fast and versatile Datalog database for everyone
💽 </p>
<p align="center">
<a href="https://central.sonatype.com/artifact/org.datalevin/datalevin-java"><img
src="https://img.shields.io/maven-central/v/org.datalevin/datalevin-java.svg?color=success"
alt="datalevin-java on maven central"></img></a>
<a href="https://www.npmjs.com/package/datalevin-node"><img
src="https://img.shields.io/npm/v/datalevin-node.svg?color=success"
alt="datalevin-node on npm"></img></a>
<a href="https://pypi.org/project/datalevin/"><img
src="https://img.shields.io/pypi/v/datalevin.svg?color=success"
alt="datalevin on pypi"></img></a>
<a href="https://clojars.org/datalevin"><img
src="https://img.shields.io/clojars/v/datalevin.svg?color=success"
alt="datalevin on clojars"></img></a>
<a
href="https://github.com/datalevin/datalevin/blob/master/doc/install.md#babashka-pod"><img
src="https://raw.githubusercontent.com/babashka/babashka/master/logo/badge.svg"
alt="bb compatible"></img></a>
</p>
<p align="center">
<a href="https://javadoc.io/doc/org.datalevin/datalevin-java/latest/"><img
src="https://javadoc.io/badge2/org.datalevin/datalevin-java/javadoc.svg"
alt="datalevin-java javadocs"></img></a>
<a href="https://cljdoc.org/d/datalevin/datalevin"><img
src="https://cljdoc.org/badge/datalevin/datalevin" alt="datalevin on
cljdoc"></img></a>
</p>

> I love Datalog, why hasn't everyone used this already?

**Datalevin** (/ˈdadə ˈlevən/, "levin" means "lightning") is a simple durable
[Datalog](https://en.wikipedia.org/wiki/Datalog) database. Here's what a Datalog
query looks like in Datalevin:

```Clojure
(d/q '[:find  ?name ?total
       :in    $ ?year
       :where [?sales :sales/year ?year]
              [?sales :sales/total ?total]
              [?sales :sales/customer ?customer]
              [?customer :customers/name ?name]]
      (d/db conn) 2024)
```

## :question: Why

The rationale is to have a simple, fast, versatile and open source Datalog query
engine running on durable storage.

It is our observation that many developers prefer
the flavor of Datalog popularized by [Datomic®](https://www.datomic.com) over
any flavor of SQL, once they get to use it. Perhaps it is because Datalog is
more declarative and composable than SQL, e.g. the automatic implicit joins seem
to be its killer feature. In addition, the recursive rules feature of Datalog
makes it suitable for [graph queries](benchmarks/LDBC-SNB-bench) and
[deductive reasoning](benchmarks/math-bench).

The feature set of Datomic® may not be a good fit for some use cases. One thing
that may [confuse some
users](https://vvvvalvalval.github.io/posts/2017-07-08-Datomic-this-is-not-the-history-youre-looking-for.html)
is its [temporal
features](https://docs.datomic.com/cloud/whatis/data-model.html#time-model). To
keep things simple and familiar, Datalevin behaves the same way as most other
databases: when data are deleted, they are gone. Datalevin also follows the
widely accepted principles of ACID, instead of introducing [unusual
semantics](https://jepsen.io/analyses/datomic-pro-1.0.7075).

In addition to support Datomic® flavor of Datalog query language, Datalevin has
a [novel cost-based query optimizer](doc/query.md) with a much better query
performance, which is competitive with SQL RDBMS such as
[PostgreSQL](benchmarks/JOB-bench) and graph databases such as
[Neo4j](benchmarks/LDBC-SNB-bench).

Datalevin provides robust ACID transaction features on the basis of [our
fork](https://github.com/huahaiy/dlmdb) of
[LMDB](https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database), known
for its high read performance. With built-in support for WAL and
asynchronous transaction, Datalevin can also handle [write intensive
workload](benchmarks/write-bench).

Datalevin can store large document (< 2 GiB) and automatically build index by
paths for JSON, EDN and Markdown
```

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/datalevin-datalevin`](/api/graphcanon/tools/datalevin-datalevin)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
