Skip to content

High-performance Rust storage engine with WAL-time KV separation, RL-driven compaction, and learned indexes

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

0xsupremedev/auradb

Repository files navigation

πŸš€ AuraDB

Crates.io License Rust GitHub stars

High-performance Rust storage engine with WAL-time KV separation, RL-driven compaction, and learned indexes

AuraDB is a next-generation storage engine designed to rival and surpass RocksDB in specific workloads by combining three core innovations:

  • πŸ”„ WAL-time Key-Value Separation (BVLSM-inspired)
  • 🧠 Adaptive RL-driven Compaction (RusKey-inspired)
  • πŸ“Š Learned Indexes (DobLIX-inspired)

✨ Features

  • Rust-first Design: Memory safety without performance cost
  • WAL-time KV Separation: 5-7Γ— improvement on large values (64KB+)
  • RL-driven Compaction: Adaptive performance tuning under dynamic workloads
  • Learned Indexes: 2-4Γ— faster reads than traditional B-trees
  • Modern Architecture: Async-first, modular design with zero-cost abstractions
  • Comprehensive Benchmarking: YCSB workloads, RocksDB comparison, performance analysis

πŸš€ Quick Start

Installation

cargo add auradb

Basic Usage

use auradb::{AuraEngine, Engine, config::Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create engine with default configuration
    let config = Config::default();
    let engine = AuraEngine::new(config)?;
    
    // Basic operations
    engine.put(b"hello", b"world").await?;
    let value = engine.get(b"hello").await?;
    println!("Value: {:?}", value);
    
    Ok(())
}

Advanced Configuration

use auradb::config::{Config, WalConfig, ValueLogConfig};

let config = Config {
    db_path: "./my_database".to_string(),
    wal: WalConfig {
        wal_path: "./my_database/wal".to_string(),
        sync_policy: 1, // fsync every write
        max_size: 64 * 1024 * 1024, // 64MB
    },
    value_log: ValueLogConfig {
        vlog_path: "./my_database/vlog".to_string(),
        max_size: 1024 * 1024 * 1024, // 1GB
    },
    ..Default::default()
};

let engine = AuraEngine::new(config)?;

πŸ“Š Performance

Current Benchmarks (M0 - Basic Implementation)

Value Size AuraDB RocksDB Improvement
1KB 2.2M ops/sec 500K ops/sec 4.5Γ— faster
8KB 45K ops/sec 70K ops/sec 0.6Γ— slower
64KB 197K ops/sec 70K ops/sec 2.8Γ— faster

Expected Performance After M1 (WAL-time KV Separation)

Value Size Expected Performance Improvement
1KB 2.2M ops/sec βœ… Already optimal
8KB 45K ops/sec βœ… Already optimal
64KB 250K+ ops/sec 5-7Γ— faster than RocksDB

πŸ—οΈ Architecture

Client API (KV + optional SQL-ish ops)
└── Router (point/scan/batch/txn)
    β”œβ”€β”€ Txn/TSO (optional MVCC)
    β”œβ”€β”€ Read Path
    β”‚   β”œβ”€β”€ Learned Index Tier (+ fallback)
    β”‚   β”œβ”€β”€ Block Cache (+ Bloom/Ribbon filters)
    β”‚   └── SST Manager (point/range reads)
    └── Write Path
        β”œβ”€β”€ WAL-time KV Separation (KV router)
        β”‚   β”œβ”€β”€ WAL (keys + meta only)
        β”‚   └── Value Log (separate big values)
        β”œβ”€β”€ Memtable(s) (skiplist/ART)
        └── Flush & SST Builder

🎯 Milestone Roadmap

  • M0 (Current): βœ… Basic LSM skeleton, in-memory performance
  • M1 (Next): WAL-time KV separation for large value optimization
  • M2: Basic LSM compaction (leveled + tiered)
  • M3: RL-driven compaction orchestration
  • M4: Learned indexes for read performance
  • M5: Value-log GC + crash recovery
  • M6: Production hardening + NUMA optimization

πŸ”¬ Benchmarking

AuraDB includes a comprehensive benchmarking suite:

# Basic performance test
cargo run --release --bin benchmark -- --operations 100000

# Full-spectrum analysis
cargo run --release --bin full_benchmark

# YCSB workload testing
cargo run --release --bin ycsb_benchmark -- --workload A --operations 50000

# RocksDB comparison
cargo run --release --bin rocksdb_comparison -- --value-size 65536

# Complete YCSB suite
cargo run --release --bin run_all_ycsb_workloads

πŸ“š Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

git clone https://github.com/0xsupremedev/auradb.git
cd auradb
cargo build
cargo test
cargo run --release --bin benchmark

πŸ“„ License

This project is licensed under either of

at your option.

πŸ™ Acknowledgments

  • BVLSM: WAL-time KV separation research
  • RusKey: RL-driven compaction inspiration
  • DobLIX: Learned indexes methodology
  • RocksDB: Performance baseline and architecture reference

🌟 Star History

Star History Chart


Built with ❀️ in Rust - GitHub | Issues | Discussions

About

High-performance Rust storage engine with WAL-time KV separation, RL-driven compaction, and learned indexes

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages