A document-based DBMS written in Rust that stores all data as files on disk, where tables are represented by folders and
each document's primary key is the filename. Every piece of data is inspectable, auditable, and compliant by design.
Modern databases prioritize speed. Cyberpath Sentinel prioritizes trust, transparency, and compliance.
rm filecat or your favorite editorrsync for replication, tar for backups, grep for queriesgit clone and you're donerm file.json and it's gone (with audit trail)# Install from crates.io
cargo install sentinel-dbms
# Or add to your Cargo.toml
[dependencies]
sentinel-dbms = "0.1"
# Or build from source
git clone https://github.com/cyberpath-HQ/sentinel
cd sentinel
cargo build --release
use sentinel_dbms::{Store, QueryBuilder, Operator, SortOrder};
use serde_json::json;
use futures::TryStreamExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a store (async I/O with optional passphrase for signing)
let store = Store::new("./data", None).await?;
// Access a collection (creates data/users/ folder if needed)
let users = store.collection("users").await?;
// Insert a document (creates data/users/user-123.json)
users.insert("user-123", json!({
"name": "Alice Johnson",
"email": "alice@example.com",
"role": "admin",
"department": "Engineering",
"age": 30
})).await?;
// Retrieve a document
if let Some(user) = users.get("user-123").await? {
println!("User: {}", serde_json::to_string_pretty(&user)?);
}
// Update a document
users.update("user-123", json!({
"name": "Alice Smith",
"email": "alice.smith@example.com",
"role": "admin",
"department": "Engineering",
"age": 31
})).await?;
// Stream all documents (memory-efficient for large collections)
let stream = users.all();
let docs: Vec<_> = stream.try_collect().await?;
println!("Total documents: {}", docs.len());
// Query with filters using predicate functions
let adults = users.filter(|doc| {
doc.data().get("age")
.and_then(|v| v.as_i64())
.map_or(false, |age| age >= 18)
});
let adult_docs: Vec<_> = adults.try_collect().await?;
println!("Adults: {}", adult_docs.len());
// Advanced querying with QueryBuilder
let query = QueryBuilder::new()
.filter("age", Operator::GreaterThan, json!(25))
.filter("role", Operator::Equals, json!("admin"))
.sort("name", SortOrder::Ascending)
.limit(10)
.offset(0)
.project(vec!["name".to_string(), "email".to_string()])
.build();
let result = users.query(query).await?;
println!("Query executed in {:?}", result.execution_time);
// Stream query results
let stream = result.documents;
futures::pin_mut!(stream);
while let Some(doc) = stream.try_next().await? {
println!("Found: {:?}", doc.data());
}
// Delete a document (soft delete to .deleted/ folder)
users.delete("user-123").await?;
Ok(())
}
The Sentinel CLI provides commands for managing stores and documents from the terminal:
# Initialize a store
sentinel init --path ./my-store
# Create a collection
sentinel create-collection --store ./my-store --name users
# Insert a document
sentinel insert \
--store ./my-store \
--collection users \
--id user-1 \
--data '{"name": "Alice", "email": "alice@example.com"}'
# Query documents
sentinel query \
--store ./my-store \
--collection users \
--filter "age>25" \
--filter "role=admin" \
--sort "name:asc" \
--limit 10 \
--project "name,email"
# Get a specific document
sentinel get --store ./my-store --collection users --id user-1
# List all documents in a collection
sentinel list --store ./my-store --collection users
# Update a document
sentinel update \
--store ./my-store \
--collection users \
--id user-1 \
--data '{"name": "Alice Smith", "email": "alice.smith@example.com"}'
# Delete a document
sentinel delete --store ./my-store --collection users --id user-1
data/
├── users/
│ ├── user-123.json
│ ├── user-456.json
│ └── .deleted/
│ └── user-789.json
├── audit_logs/
│ ├── audit-2026-01-01.json
│ └── audit-2026-01-02.json
└── certs/
├── cert-a1b2c3.pem
└── cert-d4e5f6.pem
.deleted/ folder┌─────────────────────────────────────────┐
│ Cyberpath Sentinel Client (Rust) │
├─────────────────────────────────────────┤
│ Query Engine & Filtering │
│ Transaction Manager (WAL) │
│ Caching Layer (in-memory) │
├─────────────────────────────────────────┤
│ File I/O & Concurrency Control │
│ Encryption & Signing │
│ Checksum Verification │
├─────────────────────────────────────────┤
│ Filesystem (ext4, NTFS, APFS, etc.) │
│ OS-level ACLs & Permissions │
└─────────────────────────────────────────┘
.deleted/ folder (recoverable)| Operation | Time Complexity | Notes |
|---|---|---|
| Insert | O(1) | Single file write |
| Get | O(1) | Direct filename lookup |
| Delete | O(1) | Rename to .deleted/ |
| Update | O(1) | Atomic file rename |
| List | O(n) | Scan directory for filenames |
| Filter | O(n) | Scan all files in collection |
| Index | O(n) | Build lazy indices on first query |
# Initialize store
cyberpath-sentinel init --path /var/cyberpath
# Run server
cyberpath-sentinel serve --path /var/cyberpath --port 8080
# Primary node
git init --bare /data/cyberpath.git
cyberpath-sentinel serve --path /data/cyberpath --git-push origin main
# Secondary node
git clone /data/cyberpath.git /data/cyberpath
cyberpath-sentinel serve --path /data/cyberpath --git-pull origin main
# Backup to S3 with encryption
cyberpath-sentinel backup --path /data --s3-bucket compliance-backups --encryption AES256
We welcome contributions! This is an ambitious project, and we need help with:
See CONTRIBUTING.md for guidelines.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Cyberpath Sentinel is building the gold standard for transparent, auditable data storage. We're not trying to
replace PostgreSQL or MongoDB, we're creating something new for organizations that choose accountability over speed, and
transparency over convenience.
In five years, we want Cyberpath Sentinel to be synonymous with:
Made with ❤️ for security teams, compliance officers, and developers who believe data should be transparent.