Skip to content
Petrus Pradella edited this page Jun 18, 2026 · 6 revisions

EveryDatabase

One async API. Every database. Zero lock-in.

A backend-agnostic persistence layer for the JVM. Write your data-access code once against a small, typed, CompletableFuture-based API — then run it on MySQL/MariaDB, PostgreSQL, H2, MongoDB, local files, or in-memory without changing a line. Migrate data between any two of them with a single builder.

This wiki is the developer guide !


Start here

New to the library? Walk this path:

  1. Installation — pick a distribution flavor and add one dependency.
  2. Quick Start — descriptor → storage → save/find, end to end.
  3. Defining Entities — model your data with EntityDescriptor.
  4. Architecture Overview — the five types you actually code against.

What can it do?

You want to… Go to
Read & write entities CRUD Operations
Secondary-index & query fields [[Indexing & Queries
Guard against concurrent writers Optimistic Locking
Run atomic units of work Transactions
Evolve your schema safely Schema Migrations
Pick the right engine Choosing a Backend
Cache hot data & reference entities across collections/databases [[Caching & References
Move data between backends Moving Data Between Backends
See what the library is logging [[Logging & Diagnostics

Pick a backend

Six backends behind one API. The Choosing a Backend page has the full capability matrix; the short version:

Backend Good for Transactions Migrations Indexes Optimistic locking
MySQL / MariaDB production, shared DB
PostgreSQL production, shared DB
H2 embedded / dev
MongoDB document workloads ✅¹
Local files tiny deploys, human-readable ⚠️ scan
In-memory tests / CI ✅²

¹ replica set required · ² no isolation

The manager add-on

The optional everydatabase-manager module adds typed references (Ref<K, V>) and per-type caching in front of the core — including the flagship One Entity, Many Databases pattern, where a single entity fans out across MySQL, Postgres, Mongo, H2, files and memory at once.

Reference & help

📌 Note — this wiki is maintained as a git submodule of the main repo. To contribute, see Editing this Wiki.

Clone this wiki locally