DataStack
DataStack is a high-performance, async-first embedded document database for Rust.
It provides Firestore-style collections, JSON-native updates, and zero-latency local storage by running in-process with your application.
✨ Features
- ⚡ Zero Network Latency — in-process storage with no TCP/HTTP overhead
- 📦 JSON-native via
serde_json - 📂 Collection & subcollection support (
users:u1:inbox) - ➕ Increment, field removal, and array manipulation helpers
- 🔍 Prefix-optimized scanning (
scan,batch_get) - 🛠 Dot-notation support for deep nested updates
📦 Installation
Add to your Cargo.toml:
[]
= "0.2.0"
⚡ Quick Start
use ;
let db = new.await?;
let user = json!;
db.add.await?;
let fetched = db.get.await?.unwrap;
println!;
db.update.await?;
db.delete.await?;
📂 Collections & Subcollections
db.add.await?;
let msg = db.get.await?.unwrap;
db.add.await?;
🔄 Atomic Helpers & Dot Notation
use ;
let db = new.await?;
db.add.await?;
Increment
db.update.await?;
db.update.await?;
Remove Fields
db.update.await?;
Array Operations
db.update.await?;
db.update.await?;
🔍 Batching & Scanning
let batch_docs = json!;
db.batch_add.await?;
let scanned = db.scan.await?;
let ids = json!;
let docs = db.batch_get.await?;
db.batch_delete.await?;
📝 Design Notes
- Embedded, in-process storage
- Optimized prefix-based collections
- Acid document updates
- Async and thread-safe
- Dot-notation for deep JSON updates
📜 License
MIT OR Apache-2.0