No description
Find a file
Patrick Jackson d734a157eb
Some checks failed
Coverage / coverage (inmemory) (push) Successful in 13m43s
Coverage / coverage (sqlite) (push) Successful in 11m8s
Coverage / coverage-postgres (push) Failing after 11m0s
Nix / Build (push) Successful in 11m7s
Rust / Check & Build (push) Successful in 9m44s
Rust / Test (push) Failing after 6m34s
docs: update with async description
2025-12-22 16:45:36 -08:00
.config chore(release): enable unified workspace versioning with shared git tags 2025-11-06 19:27:28 -08:00
.forgejo/workflows ci: switch to cargo-nextest and taiki-e/install-action for faster CI 2025-12-20 15:58:16 -08:00
.github ci: switch to cargo-nextest and taiki-e/install-action for faster CI 2025-12-20 15:58:16 -08:00
crates docs: update code examples for async 2025-12-22 16:33:00 -08:00
docs docs: update with async description 2025-12-22 16:45:36 -08:00
examples refactor(persistence)!: convert file I/O to async tokio::fs 2025-12-22 16:33:00 -08:00
.dockerignore chore(docker): improve .dockerignore and simplify container tasks 2025-12-17 08:27:39 -08:00
.gitignore chore: install Renovate for dependency management 2025-11-05 11:34:06 -08:00
.prettierignore docs: initialize mdbook 2025-05-01 23:42:24 -07:00
.rustfmt.toml style: standardize Rust formatting with edition 2024 2025-09-07 10:06:47 -07:00
Cargo.lock refactor(backend)!: make BackendImpl and entire library async 2025-12-22 16:33:00 -08:00
Cargo.toml feat(backend): add sqlite and postgres backends with sqlx 2025-12-19 09:59:01 -08:00
deny.toml feat(examples): add TUI chat application demonstrating sync and auth 2025-10-28 19:51:30 -07:00
Dockerfile chore: default to warn log level and remove RUST_LOG overrides 2025-12-06 22:38:36 -08:00
flake.lock chore: bump nix deps 2025-12-20 15:58:16 -08:00
flake.nix chore: extend coverage testing to run against all backends 2025-12-19 10:14:45 -08:00
LICENSE.txt chore: use AGPL license 2025-05-23 12:59:35 -07:00
README.md docs: update documentation for multi-transport sync support 2025-12-19 12:40:55 -08:00
Taskfile.yml chore: extend coverage testing to run against all backends 2025-12-19 10:14:45 -08:00

Eidetica

build coverage license

Remember Everything. Everywhere. All at once.

I wanted to search my email, so I started by building a decentralized database.

It made sense at the time...

Eidetica will allow you to write a local-first, peer-to-peer, decentralized application just by storing your data here. An app developer does not need to deal with anything else, just use the database interface provided here to store data, add a user flow to initialize sync and "login" to the network, and everything else will be handled for you.

It's not quite all there yet, but I'm working on it. Peer-to-Peer connectivity is only minimal at the moment.

Extensive, but largely LLM Generated/Human Curated documentation is maintained under docs/ and hosted on github.io.

Blog posts that I've written about Eidetica: https://jackson.dev/tags/eidetica/

Discuss on Matrix:

EXPERIMENTAL

Everything is still experimental, and very much in-development. That includes the underlying storage format, which is still GUARANTEED to change between now and declaring 1.0.

No backwards compatibility OR MIGRATION PATH is guaranteed before 1.0.

Vision

  • Peer-to-Peer Database, built on top of layered Merkle-CRDTs
  • Direct connections using iroh
  • Multi-transport sync (HTTP + Iroh P2P simultaneously)
  • Decentralized Authentication
  • Built in Rust for native compilation and broad platform support
  • Efficient Sync with a data model aware API (TODO)
  • P2P Object Storage across the same sync network (TODO)
  • Sparse and Shallow views with 0 extra overhead (TODO, data model already supports)
  • WASM for embedding it into webapps (TODO)

This is an attempt to combine a few successful decentralized approaches into something more unified, suitable for a storage layer of the decentralized web. There are a few synergies that I am taking advantage of to make each component work together efficiently, so it is more valuable to co-design the Sync API, Storage format, Authentication scheme, etc.

I wanted this for a different project and wasn't able to find something with everything I wanted, so here we are.

Eidetica lets you make a decentralized app, so long as you store your DB (and eventually, Objects), in the storage format here. It manages storage, authentication, sync, conflict resolution, and encryption. Future work includes better peer sync and discovery, user management, sparse checkouts, and many more features.

Contained here are both a library suitable for embedding in your own applications and a binary that will be a hostable multi-user synchronization node.

Under the hood it uses the Merkle-CRDT concept pioneered by OrbitDB to create an eventually consistent database by providing a total ordering of database operations to a CRDT, and extends it by layering multiple DAG's into the underlying structure. This does have downsides, and it is not suitable for all applications, but I think I can take the concept quite far by extending that architecture out into the rest of the system.

OrbitDB relies on IPFS and libp2p to sync, but by writing custom synchronization protocols that understand the data structures I expect that there are large efficiency gains to be had.

The library is extremely modular. It is simple to define your own CRDT, your own custom Backend, even your own transport layer if you need to support Bluetooth/Zigbee/etc communication.

See the docs/ for a user guide, examples, internal architecture, and full design docs explaining design decisions.

Data Model

The user facing data model is intentionally designed to match existing Databases closely.

  • Database - The fundamental unit of authentication, synchronization, and storage.
  • Store - Part of a Database, think "Table" but more general.
  • Transaction - An Atomic Operation across any number of Stores in a Database.

Stores can be any CRDT, even user defined. At the moment Eidetica provides a Doc type that is a generic nested Document type, a Table that functions as a NoSQL-ish Table for any data you want, and a PasswordStore that wraps any store with transparent password-based encryption. Behind a feature flag is also a wrapper for the popular Y-Doc CRDT type. This can be extended with more custom types to match user patterns.

Provided data types all use Last-Write-Wins conflict resolution, but facilities for other strategies will be provided.

A Transaction can operate across multiple Stores, so you can synchronize your changes to multiple Tables/Docs/etc.

Eventually, you will be able to sparsely checkout just particular Stores within a Database while still being able to locally verify the full history, and shallow checkout the current state from the network.

Contributing

At this time, outside contributions will not be accepted due to licensing considerations.

Repository

Mirrored on GitHub and Codeberg.

For practical reasons GitHub is the official repo, but use either repo to contribute. Issues can't be synced so there may be some duplicates.