obj-db
The embedded document database for Rust. Dependable. Portable. Zero-infrastructure.
Part of obj — a self-contained,
serverless, single-file document database with a stable file format and
full ACID semantics. It is to document storage what SQLite is to
relational storage.
Crate name obj-db; import as obj.
Stability. v1.0 froze the on-disk format (format_major = 1) and the
public Rust API under strict SemVer. Backwards-incompatible changes
require a 2.0 release with a migration tool; readers still open pre-1.0
(format_major = 0) files.
Quickstart
# Cargo.toml
[]
= "1.0"
= { = "1", = ["derive"] }
use Db;
use ;
Collection name and schema version default to the type name and 1;
override with #[obj(collection = "...", version = N)]. See the docs
for queries, indexes, transactions, and migrations.
Features
All features are off by default — enable with
cargo add obj-db --features <name>.
| Feature | What it does |
|---|---|
serde |
Derive Serialize/Deserialize on public types; re-export both traits. |
tracing |
Structured spans around open, transactions, queries, and checkpoints. |
compression |
LZ4 per-page compression at the pager layer. |
encryption |
ChaCha20-Poly1305 per-page at-rest encryption. |
async |
Runtime-agnostic obj::asynchronous mirror of the blocking API. |
See docs.rs/obj-db for per-feature details.
Documentation
- docs.rs/obj-db — canonical API docs, with worked examples on every public type.
- Project README — overview, other bindings, and the full documentation index.
- Format spec · Concurrency model
License
Dual-licensed under MIT or Apache 2.0, at your option.