#document-database #document-db #embedded #object

bin+lib aurora-db

Aurora: An embedded document database with tiered storage architecture

1 unstable release

new 0.1.0 Mar 17, 2025

#606 in Database interfaces

Download history 87/week @ 2025-03-12

87 downloads per month

MIT/Apache

145KB
2.5K SLoC

Aurora DB

A hybrid embedded document database with key-value storage and document collections.

Features

  • Hybrid Storage: In-memory cache + persistent disk storage
  • Document Collections: Schema-flexible JSON-like documents
  • Advanced Queries: Rich filtering, sorting and indexing
  • Blob Storage: Efficient handling of binary objects
  • Async API: High-performance operations with async/await support
  • Durability: Write-ahead logging for crash recovery

Installation

Add to your Cargo.toml:

[dependencies]
aurora_db = "0.1.0"
tokio = { version = "1", features = ["full"] }

Basic Usage

use aurora_db::{Aurora, FieldType, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Open database
    let db = Aurora::open("my_database")?;
    
    // Create collection
    db.new_collection("users", vec![
        ("name", FieldType::String, false),
        ("email", FieldType::String, true), // unique field
        ("age", FieldType::Int, false),
    ])?;
    
    // Insert document
    db.insert_into("users", vec![
        ("name", Value::String("Jane Doe".to_string())),
        ("email", Value::String("jane@example.com".to_string())),
        ("age", Value::Int(28)),
    ])?;
    
    // Query documents
    let users = db.query("users")
        .filter(|f| f.gt("age", 25))
        .collect()
        .await?;
    
    println!("Found {} users", users.len());
    
    Ok(())
}

Documentation

See the docs directory for detailed guides:

Performance

Aurora DB delivers fast performance across various operations:

Operation 'Database initialization' took: 103.54ms
Operation 'Basic KV operations' took: 307.40µs
Operation 'Collection setup' took: 3.25ms
Operation 'Query books by Author' took: 759.70µs

Status

Currently in beta. Core functionality is stable and actively developed.

License

MIT License

Dependencies

~21–35MB
~551K SLoC