Distributed database

DaoDB

DaoDB is a distributed database built on DaoStream . Datoms flow through the stream—some ephemeral, some persistent—and DaoDB selectively consumes them to materialize queryable covered indexes.

DaoStream is the flow through which datoms travel—five-element tuples [e a v t m] representing entity, attribute, value, time, and metadata. The stream itself doesn't store datoms; they flow through it, some ephemeral and transient, others consumed by apps like DaoDB that choose to materialize them. DaoDB taps into this flow and selectively materializes covered indexes from the datoms it observes. Every piece of data in DaoDB is a materialized covered index derived from the datom stream. These indexes are append-only and immutable, creating a complete history of all state changes. This isn't a database that stores current state—it's a database that stores all states, making time travel, audit trails, and undo built-in rather than bolted-on.

Not all datoms in a stream need to be stored in DaoDB. DaoDB selectively consumes the datoms it needs to materialize its indexes, deciding what to store based on query patterns and retention policies. This allows different nodes to maintain different views of the same streams—some storing everything, others keeping only recent data or specific attributes.

The Five-Element Tuple

Every datom in DaoDB follows the same structure: [e a v t m]

  • e (entity) — The thing being described (a user, a post, a shopping cart)
  • a (attribute) — The property being asserted (name, color, quantity)
  • v (value) — The actual data ("Alice", "red", 42)
  • t (time) — When this fact was recorded (timestamp/transaction ID)
  • m (metadata) — Additional context including causal relationships, encryption info, or interpreter-specific data

This structure makes every fact self-describing and independently meaningful. You can query any datom without needing to understand the entire database schema. Schemas evolve naturally as new attributes are added—no migrations, no downtime, no breaking changes.

Local-First, Globally Synced

DaoDB is fundamentally local-first. When isolated, each device maintains its own complete tuple store. But when devices entangle into a synchronization group, something profound happens: each device holds only a partial view of the whole state. Together, all devices in the entanglement group collectively maintain the complete database state .

This is quantum unitarity in a distributed system: the total information is preserved across the system, but no single observer possesses the complete state. Learn more about how DaoDB implements Relational Quantum Mechanics and why conflicts are wave function collapse.

Unlike cloud databases that force you to trust a central server, DaoDB keeps custody of your data locally. You choose which streams to expose and who can read them. Collaboration happens through shared streams, not by surrendering control to a third party.

Immutable history

Every datom is append-only. Nothing is ever deleted or overwritten. Query any point in time. Undo becomes trivial. Audit trails are built-in.

Distributed by design

DaoDB syncs across devices using CRDTs and causal ordering. Conflicts resolve automatically. No central coordination needed.

Schema-on-read

Define schemas when you query, not when you write. Add new attributes without migrations. Multiple interpreters can view the same datoms differently.

Querying the Stream

DaoDB interprets datom streams as a queryable database. By materializing covered indexes from the stream, DaoDB lets you ask questions about your data: What entities have a specific attribute? What changed between two points in time? Which datoms share causal relationships?

DaoDB implements Datomic's syntax of Datalog —a declarative query language built on Horn clauses, fixed-point semantics, and guaranteed termination. Queries are expressed as EDN data structures, making them homoiconic (code as data) and composable. Learn more about what makes Datalog Datalog and why Datalog makes every optimization queryable .

Because indexes are materialized from immutable streams, queries naturally support temporal access. Ask what the world looked like at any point in history. Track how entities evolved over time. Audit who changed what and when.

Other apps interpret the same streams differently— DaoFlow renders them as interfaces, Shibi interprets them as economic signals. DaoDB provides the database view: structured queries over flowing facts.

See how Yin agents process DaoDB streams, or explore DaoFlow to visualize the data.