GuardianDB is a high-performance, peer-to-peer database where every node keeps a full local replica. Reads and writes are instant and offline-friendly. Changes converge across peers automatically over Iroh. No servers. No central point of failure.
GuardianDB began as a Rust port of OrbitDB, but it’s no longer “OrbitDB in Rust”. The legacy IPFS / CID / libp2p stack is gone, replaced by Iroh’s QUIC transport, BLAKE3 hashing, and Willow range-based set reconciliation.
Every node holds a full replica. Reads and writes never touch a server, so your app keeps working with no connection at all.
Direct, encrypted connections via Iroh's Magicsock. NAT traversal, hole punching and Wi-Fi ⇄ 5G roaming with no global DHT.
Last-Write-Wins CRDTs and a causal DAG mean concurrent edits converge automatically. No merge conflicts, no coordinator.
Willow transfers only the diff between peers, millions of records in milliseconds. BLAKE3 + QUIC keep hashing and transport hot.
Each peer is an Ed25519 identity (its 32-byte address). Every connection is end-to-end encrypted out of the box.
Event Log, Key-Value, and Document stores. Plus an optional TypeORM/Mongoose-style ODM with schemas, indexes and CRUD.
Modern, no-compromise building blocks chosen for performance, safety and decentralization.
| Concept | Legacy (IPFS / OrbitDB) | GuardianDB (Iroh) |
|---|---|---|
| Identity | PeerID (Multihash) | EndpointID (Ed25519, 32 bytes) |
| Content ID | CID (SHA-256 + codecs) | Hash (BLAKE3) |
| Network | libp2p swarm (TCP / WS) | Iroh Endpoint (QUIC) |
| Discovery | Kademlia DHT (global) | Pkarr / DNS + mDNS, direct |
| Data format | IPLD DAG (JSON) | Binary (Postcard) |
| Sync | Bitswap (block-by-block) | Willow (range-based) |
use guardian_db::guardian::GuardianDB;
use guardian_db::p2p::network::client::IrohClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Start a local Iroh node and open a persistent database.
let client = IrohClient::development().await?;
let db = GuardianDB::new(client, None).await?;
// Open a key-value store — writes replicate to peers automatically.
let kv = db.key_value("settings", None).await?;
kv.put("theme", b"dark".to_vec()).await?;
if let Some(v) = kv.get("theme").await? {
println!("theme = {}", String::from_utf8_lossy(&v));
}
Ok(())
}GuardianDB is for building applications that need peer-to-peer synchronization, offline-first operation, and high performance without a central server. Every node keeps a full local replica, so reads and writes happen locally with no network round-trip, and changes converge across peers automatically over Iroh.
It’s a great fit when you want your data to be owned by the people using it, to keep working with zero connectivity, and to sync directly between devices and users when a connection is available.
Anywhere central servers are a cost, a bottleneck, or a single point of failure:
Because there’s no central server, you don’t scale a bottleneck, you add peers and tune how they connect and sync.
enable_discovery_mdns (LAN), enable_discovery_n0 (global Pkarr/DNS) and known_peers for bootstrapping.ClientConfig: max_peers_per_session (100 → 1000), blob cache (100 MB → 1 GB), gossip buffers and timeouts. Start from ClientConfig::production().GuardianDB is in active development and there will be breaking changes. There are no stability guarantees at this stage, though resulting issues are usually easy to fix. It’s dual-licensed under MIT and Apache 2.0, so it’s free to use, study and build on.
The core is a native Rust crate (guardian-db on crates.io). There’s also an optional ODM layer with derive macros for schema modeling, and a TypeScript/JavaScript SDK that exposes a MongoDB-style collection API (insertOne, find, update with $set/$inc, and more).
If you’re into distributed systems, Iroh, decentralized databases, or just want to get your hands dirty with a different kind of open-source project, join us! Whether it’s code, docs, ideas or bug reports, there’s a place for you here.