Core Capabilities
Git-Native
Database transactions are stored as standard Git objects. Every write is a commit, every sync is a push.
SQLite Sidecar
Reads are served from a materialized SQLite index. Get the write speed of append-only logs with the query power of SQL.
Tamper-Evident
Built on a Merkle DAG. Every state change is cryptographically linked to its parent. History cannot be rewritten without detection.
Offline-First
Writes occur locally and sync asynchronously. The system is designed for partition tolerance and eventual consistency.
Strict Schema
Enforce structure with JSON Schema. Writes are validated before they hit the ledger, ensuring data quality at the source.
Atomic CAS
Concurrency is handled via optimistic locking (Compare-And-Swap) on the Git reference. No global locks required.
Quick Start
Git-native ledger with a SQLite sidecar index.
# 1. Build
$ make build
# 2. Init repo (sharded + append history)
$ ledgerdb init --name "LedgerDB" --repo ./ledgerdb.git \
--layout sharded --history-mode append
# 3. Apply schema
$ ledgerdb collection apply tasks \
--schema ./schemas/task.json \
--indexes "status,assignee"
# 4. Write data
$ ledgerdb doc put tasks "task_0001" \
--payload '{"title":"Ship v1","status":"todo","priority":"high"}'
✔ Commit 8a7b9c written._
System Design
History lives in documents/. State in state/. Schema in collections/.
- schema.json
- indexes.json
- HEAD POINTER
- tx/2025..._put.txpb
- tx/2025..._patch.txpb
- HEAD POINTER
- tx/current.txpb
CAS Write Flow
Atomic compare-and-set on refs/heads/main.
Read Ref
Read HEAD
Build Tx
Hash
Validate
Write Blobs
Commit
CAS
Retry
Write Throughput
Writes are O(1) appends. Reads served from SQLite sidecar.