Datahike Documentation
September 14, 2026 ยท View on GitHub
Welcome to the Datahike documentation! This index organizes all documentation by topic and user level.
๐ Getting Started
New to Datahike? Start here:
- Main README - Project overview, installation, and quick start
- Why Datalog? - Query comparisons and when to use Datalog
- Configuration - Database configuration options
- Schema Flexibility - Schema-on-read vs schema-on-write
๐ Core Concepts
Essential concepts for working with Datahike:
- Time Variance - Time-travel queries (as-of, history, since), audit trails, and GDPR-compliant purging
- Storage Backends - Choosing the right backend for your needs (file, memory, PostgreSQL, etc.)
- Garbage Collection - Reclaim storage by removing old database snapshots
- Blobs and out-of-line values -
:db.type/store-reffor objects you fetch, not query, kept alive by the collector (experimental) - Entity Spec - Entity API and specifications
- Logging and Error Handling - Debugging and error management
๐ง Language Bindings (Beta)
Datahike supports multiple languages and platforms:
JVM Languages
- Java API - Fluent builder API, automatic collection conversion, comprehensive bindings
- Examples:
examples/java/ - Status: Beta - Functional and tested, but may receive breaking changes
- Examples:
JavaScript/TypeScript
- JavaScript API - Promise-based API for Node.js and browsers
- Browser replicas - Datahike in the browser, writing through a server, with permissions
- npm:
npm install datahike@next - Status: Beta - Functional and tested, but may receive breaking changes
- npm:
ClojureScript
- ClojureScript Support - Async operations, Node.js, IndexedDB, and browser backends
- Backends: Memory, IndexedDB, TieredStore, File (Node.js)
- Status: Beta - Functional, please try it out and provide feedback
Python
- Python Bindings - High-level Pythonic API with automatic EDN conversion
- Status: Beta - Functional and tested, but may receive breaking changes
CLI & Shell
-
CLI (dthk) - Native command-line tool compiled with GraalVM
- Features: Instant startup, file backend, scriptable
- Status: Beta - Functional and tested, but command structure may change
-
Babashka Pod - Shell scripting with Datahike
- Integration: Native pod for Babashka
- Status: Beta - Functional but not yet used in production
Native Libraries
-
libdatahike - C/C++ native bindings for embedding in non-JVM applications
- Use cases: Embedding in C/C++/Rust/Go applications
- Status: Beta - Functional and tested, but API may change
-
EDN Conversion Rules - How data types map between languages
๐๏ธ Advanced Features
For experienced users building production systems:
- Compiled Query Engine - Fused scan execution, ORDER BY, query result cache,
d/explain(beta; default engine) - Secondary Indices - Full-text search, vector similarity, columnar aggregates (experimental)
- Distributed Architecture - Distributed Index Space and real-time sync with Kabel
- Reducing write amplification - Cut objects-per-commit on request-priced object stores: diff buffering, root fusion, commit-graph opt-out (experimental)
- Index warming - Cut a cold reader's
misses ร RTTon high-latency stores: budget-bounded breadth-first prefetch of index levels, fetched concurrently (experimental) - Cross-database references -
dh://URIs and reified links across databases (living vs record references) - Optimistic Overlay - Zero-latency UI updates over a remote writer via
d/with(beta) - Snapshot dependency tracking - Runtime tokens for caches of selected attributes (experimental)
- Versioning - Git-like branching and merging (beta)
- Migration - One record stream, three jobs: backup/restore via portable verifiable dumps, moving between storage backends, and reading from or writing to other systems via
import-source/export-to-sink(beta) - Migrating from Datomic - Datomic Pro in and out over that seam, with what survives a round trip and what cannot (experimental; may move out of datahike into its own library)
- Norms - Database migration system
- Unstructured Input Support - Schema inference from JSON/EDN (experimental)
- Graph Algorithms - Reachability, paths, centrality, community detection, flows, random walks over a
GraphSpec(experimental) - Anomaly Detection - Parameter-free ECOD outlier detection (experimental)
๐ Reference
- Differences to Datomic - API compatibility and differences
- Benchmarking - Performance testing and optimization
๐ ๏ธ Development
Contributing to Datahike:
- Contributing Guide - How to contribute to the project
- Backend Development - Creating custom storage backends
Feature Maturity Levels
- Stable - Production-ready, API unlikely to change
- Beta - Tested and functional, but API may receive changes
- Experimental - Try it out, API likely to change significantly
Need Help?
- ๐ฌ Discussions - Ask questions and share ideas
- ๐ Issues - Report bugs or request features
- ๐ API Docs - Complete API reference on cljdoc