whatisgithub

What is datomlite?

mattlianje/datomlite — explained in plain English

Analysis updated 2026-05-18

16ScalaAudience · developerComplexity · 3/5Setup · easy

In one sentence

An embedded, dependency-free Scala database that lives inside your program as an in-memory value, with typed queries, full history, and safe concurrent writes.

Mindmap

mindmap
  root((Datomlite))
    What it does
      Embedded Scala database
      Database as a value
      Full history log
    Tech stack
      Scala 3
      Scala.js
      JVM
    Use cases
      Schema-free storage
      Time travel queries
      Datalog-style joins
    Audience
      Scala developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a schema-free embedded database to a Scala app using ordinary case classes.

USE CASE 2

Query past states of your data or compare two snapshots using its built-in time travel.

USE CASE 3

Run typed Datalog-style queries with joins, aggregations, and recursive rules over in-memory data.

What is it built with?

Scala 3Scala.jsJVM

How does it compare?

mattlianje/datomlitestarlake-ai/quack-on-demandjanikdotzel/akka-http-quickstart-scala
Stars1613
LanguageScalaScalaScala
Last pushed2023-05-19
MaintenanceDormant
Setup difficultyeasymoderateeasy
Complexity3/54/52/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

So what is it?

Datomlite is a small embedded database written in Scala 3, meant to be dropped straight into another Scala program rather than run as a separate server. It has no dependencies outside of Scala itself and works on the JVM, in JavaScript through Scala.js, and as a native binary. The author describes it as a database as a value, meaning the database is an in-memory object that you create, write to, and read from like any other Scala value, no setup file or schema definition step required. The schema is whatever ordinary case classes you define. You derive a marker called Entity on each case class, and that case class becomes the shape of records in the database. Behind the scenes, each record is split into entry-attribute-value triples and written to an append-only log, then rebuilt back into typed Scala objects when you read. Because the log only grows, every past state of the database stays around, which lets you ask what the data looked like at an earlier point or compare two snapshots. Reads are done with a typed query API that looks like normal Scala collections. You can call db.where to list rows, filter them, count them, take the first match, or run for-comprehensions over multiple entity types to do joins. There is also a Datalog-style query block, plus support for projections, aggregations, sorting and paging, named-tuple results, window functions, recursive rules, anti-joins, and a pull form that lets you shape the output, including following references in reverse. Writes go through transactions that commit atomically, so either every assert and retract in a block succeeds or none do. Multiple threads can transact at the same time, conflicts are resolved by a compare-and-swap retry loop, so there is no single-writer lock. Reads always operate on an immutable snapshot taken at the start of the call, which makes the read code easy to reason about. Storage can be plugged in by implementing a Storage interface, so the live in-memory projection can be backed by whatever persistence layer fits the host application. The README also lists time travel, change listeners, predicates that lower to index probes, and debug pretty-printing of state and log. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Help me define a case class with the Entity marker to store records in Datomlite.
Prompt 2
Show me how to write a Datomlite query with a for-comprehension that joins two entity types.
Prompt 3
Explain how Datomlite's append-only log enables time travel over past database states.
Prompt 4
Walk me through implementing a custom Storage backend to persist Datomlite's in-memory data.

Frequently asked questions

What is datomlite?

An embedded, dependency-free Scala database that lives inside your program as an in-memory value, with typed queries, full history, and safe concurrent writes.

What language is datomlite written in?

Mainly Scala. The stack also includes Scala 3, Scala.js, JVM.

How hard is datomlite to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is datomlite for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.