Liking cljdoc? Tell your friends :D

corium

A database system in the style of Datomic — immutable, time-aware, and fact-oriented, with Datalog queries and peer-local query execution — written in Rust, paired with Clojurust for EDN/Clojure data handling and database function execution.

The peer also exposes SQL through the corium-sql Rust crate, a read-only corium sql shell, and an opt-in PostgreSQL wire server with guarded autocommit DML; see the SQL interface. corium tui opens a full-screen terminal dashboard — query workbench, live store metrics, transaction feed, and schema browser; see the operations guide.

All roadmap milestones (M0–M7, through active/standby high availability) are implemented. Start with the getting-started guide, work through the MusicBrainz example for an end-to-end tour (schema, data loader, and a Clojurust query REPL over in-memory, filesystem, or Turso storage), use the operations guide for PostgreSQL-backed deployment and recovery, and see PLAN.md for current status. Design documents, the roadmap, and architecture decision records live in docs/.

Getting started

Corium builds with a recent stable Rust toolchain. From the repository root:

cargo build --workspace
cargo test --workspace

Start a local transactor (here fully in-memory, so there is nothing to clean up afterwards):

cargo run -p corium-cli -- transactor --store mem --data-dir ./corium-data \
  --listen 127.0.0.1:4334

Then, in another terminal, create a database from a schema and open the interactive query console:

cargo run -p corium-cli -- db create people --schema schema.toml
cargo run -p corium-cli -- console people

The console accepts EDN Datalog directly:

[:find ?name ?age
 :where [?e :person/name ?name]
        [?e :person/age ?age]]

The getting-started guide has the full walkthrough (schema file, other storage backends, transacting data); the MusicBrainz example is a one-command end-to-end tour.

Workspace layout

Corium is a single Cargo workspace. Dependency edges point strictly downward: corium-core at the base, the pure engine crates above it, then the async / networked crates, with corium-cli composing everything into runnable processes. Each crate has its own README.

CrateWhat it does
corium-coreValue, sortable encoding, Datom, ids, partitions, schema model, errors
corium-indexImmutable covering-index segments (EAVT/AEVT/AVET/VAET) whose leaves are the published chunks; incremental apply with structural sharing
corium-storeBlobStore + RootStore traits; memory/fs/postgres/turso/s3 backends; segment cache
corium-logDurable append-only transaction log: format, append/replay, range scans
corium-txTransaction expansion, tempid/lookup resolution, schema validation, built-in tx fns
corium-dbThe immutable Db value: time views, covering-index access, naming, stats
corium-queryEDN Datalog compiler/planner/executor, rules, aggregates, Pull, entity API
corium-sqlDataFusion SQL and autocommit mutation planning over peer-local Db values
corium-pgwirePostgreSQL wire-protocol front end for Corium SQL
corium-protocolprotobuf/gRPC definitions, wire value encoding, generated tonic stubs
corium-transactorTransactor process: pipeline, indexing job, lease/HA, gRPC server, backup
corium-peerPeer library: connection, tx-report handling, segment cache, peer server
corium-clientFluent async Datomic-style API over the peer library and peer-server gRPC; typesafe Datalog/Pull builders
corium-ffiOwned, runtime-neutral facade for native language bindings
corium-jniJNI adapter that runs an in-process peer for the Java client
corium-cljrsClojurust bindings: value conversion, corium.api, :db/fn sandbox host
corium-clicorium binary: launchers, admin commands, console, TUI, SQL shell
corium-simDeterministic simulation harness for fault-injection tests (not published)

Language clients live under clients/; clients/python provides the shared asynchronous local/remote Python API, clients/java provides the Java API, and clients/clojure provides synchronous and core.async JVM Clojure APIs over the published Java client.

Examples

  • examples/musicbrainz — a corium port of the Datomic MusicBrainz sample: schema, a streaming data loader, and a Clojurust query REPL, with one-command scripts for in-memory, filesystem, and Turso storage.
  • examples/postgres-jdbc — a Java/Maven client that starts an in-memory transactor, loads the 20-release MusicBrainz wasm fixture, and checks SQL queries through the PostgreSQL JDBC driver.

Can you improve this documentation? These fine people already did:
Casey Marshall & Claude
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close