Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ bytes = "1.0"
# Synchronization primitives
parking_lot = "0.12"

# Lock-free concurrent skip list (memtable)
crossbeam-skiplist = "0.1"

# Compression
lz4_flex = "0.11"

Expand Down
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# RooDB

A highly available, high performance, easy to use distributed SQL database.
The fastest SQL database on a single machine.

RooDB is built to extract every last drop of performance from modern
multi-core CPUs and high-speed storage devices (NVMe SSDs, Optane).
On single-node and leader-replica configurations, nothing should be faster.

## Goals

* A general SQL database that is fast out-of-the-box for everyone
* General purpose, Highly available, Self-tuning
* Single node or multi-node (leader+replicas) configurations
* Near-zero config
* **Maximum single-node throughput** — saturate all cores and I/O bandwidth with lock-free data structures, io_uring, and a unified memory budget that adapts to workload in real time
* **General purpose SQL** — not a niche engine; a real database for real workloads, fast out-of-the-box without tuning
* **High availability** — optional Raft replication across leader + replicas, with reads served locally
* **Near-zero config** — self-tuning defaults that just work; no knob-turning required

## Why RooDB?

roodb should be high performance for all but the most massive,
sharded-cluster workloads.
Most SQL databases were designed in an era of slow disks and single-core CPUs.
RooDB is designed from scratch for today's hardware: dozens of cores, millions
of IOPS from NVMe, and kernel-bypass I/O via io_uring. The result is a database
that keeps the hardware busy instead of waiting on locks and syscalls.

## Features

- **Raft Consensus**: Distributed replication via OpenRaft for high availability
- **LSM Storage Engine**
- **SQL Support**: Parser (sqlparser-rs), query planner with optimizer, Volcano-style executor
- **Cross-Platform I/O**: io_uring on Linux, async POSIX fallback on other platforms
- **MySQL-Compatible Protocol**: Connect using standard `mysql` CLI or any MySQL client library (TLS required)
- **io_uring I/O** — zero-copy, kernel-bypass I/O on Linux; async POSIX fallback elsewhere
- **Lock-free memtable** — concurrent skip list for zero-contention writes
- **Unified memory budget** — block cache and memtables share a single adaptive pool
- **LSM storage engine** — write-optimized with cascading compaction
- **Raft consensus** — distributed replication via OpenRaft for high availability
- **Full SQL** — parser, query planner with optimizer, Volcano-style executor
- **MySQL-compatible protocol** — connect with `mysql` CLI or any MySQL client library (TLS required)

## Quick Start

Expand Down
5 changes: 4 additions & 1 deletion src/bin/roodb_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ async fn main() {

// Open storage engine
let io_factory = Arc::new(default_io_factory());
let storage_config = LsmConfig { dir: data_dir };
let storage_config = LsmConfig {
dir: data_dir,
..Default::default()
};
let storage: Arc<dyn StorageEngine> = match LsmEngine::open(io_factory, storage_config).await {
Ok(engine) => Arc::new(engine),
Err(e) => {
Expand Down
26 changes: 26 additions & 0 deletions src/executor/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use super::delete::Delete;
use super::distinct::HashDistinct;
use super::error::{ExecutorError, ExecutorResult};
use super::filter::Filter;
use super::hash_join::HashJoin;
use super::insert::Insert;
use super::join::NestedLoopJoin;
use super::limit::Limit;
Expand Down Expand Up @@ -157,6 +158,31 @@ impl ExecutorEngine {
)))
}

PhysicalPlan::HashJoin {
left,
right,
join_type,
left_keys,
right_keys,
condition,
} => {
let left_width = left.output_columns().len();
let right_width = right.output_columns().len();

let left_exec = self.build_node(*left)?;
let right_exec = self.build_node(*right)?;
Ok(Box::new(HashJoin::new(
left_exec,
right_exec,
join_type,
left_keys,
right_keys,
condition,
left_width,
right_width,
)))
}

PhysicalPlan::HashAggregate {
input,
group_by,
Expand Down
Loading