Aurora DB
A lightweight, real-time embedded database designed for modern applications.
Why Aurora Exists
Most embedded databases force you to choose: either simple key-value storage with manual indexing and caching, or heavy SQL databases with complex setup.
Aurora aims to fill the gap for building real-time applications without external services. It combines storage, indexing, caching, pub/sub, and background workers into a single embedded crate.
The Philosophy
Real-time by default. Data changes can propagate instantly using built-in PubSub. Lightweight. Embedded directly into your application binary. Hybrid Architecture. Frequently accessed data lives in memory (Hot Cache), while the rest persists to disk (Cold Storage via Sled).
Quick Start
Installation
[]
= "0.5.0"
Basic Usage
You can interact with Aurora using either the Native Rust API (builder pattern) or AQL (Aurora Query Language).
Option 1: Native Rust API
Best for type safety and direct integration in Rust code.
use ;
async
Option 2: Aurora Query Language (AQL)
Best for flexible queries, scripts, or exposing an API.
use Aurora;
async
Feature Overview
⚡ Reactive Subscriptions
Listen to changes in real-time.
Rust API:
let mut sub = db.subscribe.await?;
while let Ok = sub.recv.await
AQL:
subscription {
users(where: { active: { eq: true } }) {
mutation
node { name }
}
}
🔍 Computed Fields
Derive values on the fly without storing them.
Rust API:
registry.register;
AQL:
query {
users {
# Template string interpolation
display: "${first_name} ${last_name}"
# Pipe syntax
status_label: status | uppercase
}
}
🛠️ Background Jobs
Enqueue durable background jobs.
Rust API:
db.enqueue_job.await?;
AQL:
mutation {
enqueueJob(type: "send_email", payload: { ... }, priority: NORMAL)
}
Architecture
Aurora uses a hybrid storage architecture:
┌─────────────────────────────────────────┐
│ Application Layer │
├─────────────────────────────────────────┤
│ PubSub │ Reactive │ Workers │ Computed │
├─────────────────────────────────────────┤
│ AQL Engine │ Rust Builder API │
├─────────────────────────────────────────┤
│ Hot Cache (In-Memory) │ Indices │
├──────────────────────────┴───────────────┤
│ Cold Storage (Sled - On Disk) │
└─────────────────────────────────────────┘
Documentation
- Schema Management
- CRUD Operations
- Querying Guide
- PubSub & Real-time
- Reactive Queries
- Durable Workers
- Computed Fields
- Performance
License
MIT License - see LICENSE file for details