datalevin/datalevin

A simple, fast and versatile Datalog database

What it solves

Datalevin is a durable Datalog database designed to be a simple, fast, and versatile alternative to SQL and graph databases. It addresses the complexity of SQL by providing a more declarative and composable query language, while avoiding the complex temporal features of some other Datalog implementations to maintain a familiar ACID-compliant behavior where deleted data is permanently gone.

How it works

Datalevin uses a cost-based query optimizer to achieve performance competitive with RDBMS like PostgreSQL and SQLite. It is built on a fork of LMDB (Lightning Memory-Mapped Database) to ensure high read performance and robust ACID transactions, supporting both Write-Ahead Logging (WAL) and asynchronous transactions for write-intensive workloads. It can operate as an embedded library (similar to SQLite) or in a networked client/server mode with Raft-based high availability and role-based access control (RBAC).

Who it’s for

It is designed for developers who prefer Datalog's declarative nature and implicit joins over SQL, as well as those needing a database that can handle relational, graph, document, and key-value data models. It is particularly useful for Clojure programs due to its native EDN data capabilities.

Highlights

  • Multi-model capabilities: Supports Datalog queries, document storage (JSON, EDN, Markdown) with automatic path indexing, vector database features via SIMD acceleration, and full-text search.
  • AI-native features: Includes a built-in local MCP server and supports in-DB embedding and text generation via integrated llama.cpp.
  • High Performance: Outperforms several alternatives in benchmarks for relational (JOB), graph (LDBC SNB), document (idoc), and logic (OpenRuleBench) workloads.
  • Broad Language Support: Provides libraries for Java, Python, Node.js, and Clojure, and is compatible with babashka pods.

Related

  • Project
  • Project
  • Project
  • Project
  • Project