DataScript

active

by Nikita Prokopov (tonsky) · since 2014

Immutable in-memory database with Datomic-style Datalog queries for Clojure, ClojureScript and JavaScript.

graphkey-valueembedded libraryopen source (copyleft)mature

Overview

DataScript, by Nikita Prokopov (tonsky), is an immutable in-memory database and Datalog query engine that brings Datomic's data model to the browser and the JVM. Data is stored as entity-attribute-value datoms in sorted indexes, every transaction returns a new database value instead of mutating state, and you query with Datalog, the pull API or entity navigation. That makes it a natural single source of truth for front-end application state: views can query it reactively and old values are cheap to keep for undo. Since version 1.5 it can also persist to pluggable durable storage on the JVM. It is actively maintained (1.8.1, August 2026) and underpins tools such as Roam Research, Logseq and Athens.

Strengths & trade-offs

Strengths

  • +Datomic-compatible data model and Datalog queries in the browser
  • +Immutable database values make undo, diffing and reactive views simple
  • +Pull API and entity navigation for tree-shaped reads
  • +Small, dependency-light library with long-term active maintenance

Trade-offs

  • −Entire database must fit in memory
  • −No built-in history or as-of queries like Datomic
  • −Durable storage only on the JVM, not in JavaScript
  • −Datalog performance degrades on very large datasets

Great for

  • +Client-side application state for ClojureScript apps
  • +Local-first note-taking and outliner tools
  • +In-memory graph queries over modest datasets

Think twice for

  • −Datasets larger than memory
  • −Multi-user server-side databases
  • −Audit history requirements

Capabilities

Native or official first-party support · 5 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓In-memory
✓Durable persistence
–Full-text search
–Vector search
–Geospatial
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–Columnar storage
–Compression
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Small · ≤ 100 GB
Horizontal scaling
None
Multi-region
No
Transactions
Full ACID
Consistency
Strong
Schema
Flexible
Architecture
Embedded, In memory
Query languages
Datalog, Pull API

Whole database lives in memory of one process; optional JVM storage persists and lazily loads index segments.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsClojure API, ClojureScript API, JavaScript API
client languagesClojure, ClojureScript, JavaScript
used byRoam Research, Logseq, Athens Research

Alternatives to DataScript

Compare all→
DatomicRelational14.9

Immutable Datalog database from Nubank where every fact is timestamped and queries run in the app process.

datascript vs datomic →
DatahikeRelational5.8

Open-source, durable Datalog database for Clojure with Datomic-style immutable history.

datascript vs datahike →
XTDBRelational8.3

Bitemporal SQL database on object storage that keeps every version of every row.

datascript vs xtdb →
CozoDBGraph13.9

Embedded Datalog database blending relational, graph and vector queries; dormant since 2024.

datascript vs cozodb →
RxDBDocument20.2

Reactive local-first NoSQL database for JavaScript with pluggable storage and replication.

datascript vs rxdb →
GUNGraph26.6

Decentralised, offline-first graph database that syncs peer-to-peer in JavaScript.

datascript vs gun →

DataScript FAQ

What is DataScript?

DataScript is a graph database by Nikita Prokopov (tonsky), first released in 2014. DataScript, by Nikita Prokopov (tonsky), is an immutable in-memory database and Datalog query engine that brings Datomic's data model to the browser and the JVM. Data is stored as entity-attribute-value datoms in sorted indexes, every transaction returns a new database value instead of mutating state, and you query with Datalog, the pull API or entity navigation. That makes it a natural single source of truth for front-end application state: views can query it reactively and old values are cheap to keep for undo. Since version 1.5 it can also persist to pluggable durable storage on the JVM. It is actively maintained (1.8.1, August 2026) and underpins tools such as Roam Research, Logseq and Athens.

Is DataScript open source?

Yes. DataScript is open source. License: Eclipse Public License 1.0.

Does DataScript support ACID transactions?

Yes. DataScript supports full ACID transactions, with strong consistency.

Does DataScript scale horizontally?

DataScript does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).

How can I run DataScript?

You can self-host it and embed it in your application.

What is DataScript best for?

DataScript is a strong fit for client-side application state for ClojureScript apps; local-first note-taking and outliner tools; and in-memory graph queries over modest datasets. Think twice for datasets larger than memory.

What are the best alternatives to DataScript?

Common alternatives to DataScript include Datomic, Datahike, XTDB, CozoDB and RxDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is DataScript?

DataScript ranks #233 of 844 databases on the WhichDB Score (14.4/100), and #18 among graph databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.