AEDB
aedb is an embedded Rust storage engine for applications that need:
- transactional writes
- durable WAL + checkpoint recovery
- snapshot-consistent reads
- optional permission-aware APIs for multi-tenant workloads
Primary API entry point: AedbInstance.
Why AEDB
AEDB is designed for local-first and service-side state where you want predictable durability and recovery behavior without running an external database process.
Use AEDB when you want:
- in-process storage with explicit durability controls
- deterministic crash recovery from checkpoint + WAL replay
- table + KV data models in one engine
- operational APIs for checkpoint, backup, restore, and diagnostics
Installation
[]
= "0.1"
= { = "1", = ["macros", "rt-multi-thread"] }
Quick Start
use AedbInstance;
use DdlOperation;
use ColumnDef;
use ;
use Mutation;
use ;
use tempdir;
async
Core Concepts
Data model
- Namespace hierarchy:
project -> scope -> table - Typed relational tables for structured data
- KV APIs for point lookups, prefix/range scans, and counters
Consistency modes
Reads are snapshot-based and configurable via ConsistencyMode:
AtLatestAtSeqAtCheckpoint
use ;
let result = db
.query_with_options
.await?;
println!;
Preflight and commits
preflightandpreflight_planare advisory- state may change before commit
- use
commit_with_preflight/commit_as_with_preflightfor lowest TOCTOU risk - use
commit_with_finality(..., CommitFinality::Visible)for low-latency user ack - use
CommitFinality::Durablefor flows that must wait for WAL durability
Low-latency profile example:
use AedbConfig;
let config = low_latency;
let db = open?;
Security and Permissions
AEDB supports permission-aware APIs via CallerContext and Permission.
open_productionandopen_securerequire authenticated*_ascallsopen_secureenforces hardened durability/recovery settings- table/KV/query access can be scoped per project/scope/resource
Operational APIs
checkpoint_now()to force a checkpointbackup_full(...)/ restore helpers for backup workflowsoperational_metrics()for commit latency, queue depth, durable head lag, and more
CLI helper (src/bin/aedb.rs) includes offline dump/parity/invariant tooling:
API Areas
aedb::commit: mutations, envelopes, validationaedb::query: query planning and executionaedb::catalog: schema, types, and DDLaedb::repository: typed repository/pagination helpersaedb::declarative: declarative schema migration buildersaedb::backup,aedb::checkpoint,aedb::recovery: durability and restore path
Development
Focused suites:
License
Dual-licensed under:
- MIT (
LICENSE-MIT) - Apache-2.0 (
LICENSE-APACHE)