| Crates.io | koru-delta |
| lib.rs | koru-delta |
| version | 1.0.0 |
| created_at | 2025-11-25 18:03:22.522762+00 |
| updated_at | 2025-11-25 18:03:22.522762+00 |
| description | The invisible database: causal, consistent, and everywhere—without configuration |
| homepage | |
| repository | https://github.com/swyrknt/koru-delta |
| max_upload_size | |
| id | 1950200 |
| size | 482,897 |
Tagline: "Invisible. Causal. Everywhere."
One-line: "KoruDelta is the invisible database that gives you Git-like history, Redis-like speed, and distributed consistency—without configuration."
use koru_delta::KoruDelta;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let db = KoruDelta::start().await?;
db.put("users", "alice", serde_json::json!({
"name": "Alice",
"email": "alice@example.com"
})).await?;
let user = db.get("users", "alice").await?;
println!("User: {:?}", user);
Ok(())
}
KoruDelta::start() is all you need. No config files, no cluster rituals.
Multiple nodes? KoruDelta automatically syncs and keeps data consistent.
Every change is versioned. Time travel and auditing are one method away.
// Get the full history of changes
let history = db.history("users", "alice").await?;
// Time travel to a specific point
let past_user = db.get_at("users", "alice", timestamp).await?;
Same core engine runs in servers, laptops, browsers, and edge devices.
Multiple nodes sync automatically with zero configuration:
# Machine 1 - Start a node
kdelta start
# Machine 2 - Join the cluster
kdelta start --join 192.168.1.100:7878
# Now you have a distributed cluster!
Filter, sort, and aggregate your data with a fluent query API:
use koru_delta::query::{Query, Filter, Aggregation};
// Find active users over 30, sorted by name
let results = db.query("users", Query::new()
.filter(Filter::gt("age", 30))
.filter(Filter::eq("status", "active"))
.sort_by("name", true)
.limit(10)
).await?;
// Aggregate sales by region
let total = db.query("sales", Query::new()
.aggregate(Aggregation::sum("amount"))
).await?;
Pre-compute and cache query results for instant access:
use koru_delta::views::ViewDefinition;
// Create a view of active users
let view = ViewDefinition::new("active_users", "users")
.with_query(Query::new().filter(Filter::eq("status", "active")))
.auto_refresh(true);
db.create_view(view).await?;
// Query the view (instant, cached results)
let results = db.query_view("active_users").await?;
Get notified when data changes:
use koru_delta::subscriptions::Subscription;
// Subscribe to user changes
let (id, mut rx) = db.subscribe(Subscription::collection("users")).await;
// React to changes in real-time
while let Ok(event) = rx.recv().await {
println!("Change: {} {}/{}", event.change_type, event.collection, event.key);
}
# Basic Operations
kdelta set users/alice '{"name": "Alice", "age": 30}'
kdelta get users/alice
kdelta log users/alice # Show history
kdelta diff users/alice # Compare versions
# Cluster Operations
kdelta start # Start a node
kdelta start --join 192.168.1.100 # Join existing cluster
kdelta peers # Show cluster peers
kdelta status # Show database stats
# Query Operations
kdelta query users # Get all users
kdelta query users --filter 'age > 30' # Filter
kdelta query users --sort name --limit 10 # Sort and limit
kdelta query users --count # Count records
kdelta query sales --sum amount # Aggregate
# View Operations
kdelta view create active_users users --filter 'status = "active"'
kdelta view list
kdelta view refresh active_users
kdelta view query active_users
kdelta view delete active_users
# Watch for Changes
kdelta watch users # Watch collection
kdelta watch users/alice # Watch specific key
kdelta watch --all # Watch everything
KoruDelta is built on top of koru-lambda-core, a minimal axiomatic system for distributed computation. This gives KoruDelta:
The math is your secret weapon, not your configuration burden.
All three phases complete! KoruDelta is feature-complete and production-ready.
get_at)kdelta)kdelta start --join)The examples/ directory contains runnable demos:
# E-Commerce demo: CRUD, versioning, queries, views, subscriptions
cargo run --example ecommerce_demo
# Clustering demo: Multi-node replication and peer discovery
cargo run --example cluster_demo
We welcome contributions! Please see CONTRIBUTING.md for guidelines and ARCHITECTURE.md for technical details.
This project is licensed under either of:
at your option.
KoruDelta: Where data meets history, and simplicity meets power.