A highly available, high performance, easy to use distributed SQL database.
- 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
roodb should be high performance for all but the most massive, sharded-cluster workloads.
- 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
mysqlCLI or any MySQL client library (TLS required)
# Generate TLS certificate
mkdir -p certs
openssl req -x509 -newkey rsa:4096 -keyout certs/server.key -out certs/server.crt \
-days 365 -nodes -subj "/CN=localhost"
# Initialize database (first time only, idempotent)
ROODB_ROOT_PASSWORD=secret ./target/release/roodb_init --data-dir ./data
# Start server
./target/release/roodb --port 3307 --data-dir ./data --cert-path ./certs/server.crt --key-path ./certs/server.keymysql -h 127.0.0.1 -P 3307 -u root -p --ssl-mode=REQUIRED# Run all tests (single-threaded - see Known Limitations)
cargo test --release
# Run a specific test
cargo test --release test_name
# Lint
cargo clippy --all-targetssrc/
├── catalog/ # Schema catalog (tables, columns, system tables)
├── executor/ # Volcano-style query executor
├── io/ # Cross-platform async I/O (io_uring / POSIX)
├── planner/ # Query planner and optimizer
├── protocol/ # MySQL wire protocol implementation
├── raft/ # Raft consensus layer (OpenRaft)
├── server/ # TCP listener, connection handling
├── sql/ # SQL parsing and AST
├── storage/ # LSM storage engine
├── tls.rs # TLS configuration
└── txn/ # Transaction management (MVCC)
Replication Model:
- Leader accepts all writes, replicates via Raft
- Replicas serve read-only queries from local storage
- Schema stored in system tables, replicated like data
- Raft log serves as the write-ahead log
RooDB includes a comprehensive integration test suite that validates the full SQL stack across 4 configurations:
| Configuration | Cluster | I/O Backend |
|---|---|---|
single_uring |
1-node | io_uring (Linux only) |
single_posix |
1-node | POSIX |
cluster_uring |
3-node Raft | io_uring (Linux only) |
cluster_posix |
3-node Raft | POSIX |
Tests use the mysql CLI to execute SQL against RooDB's client protocol.
Key dependencies:
openraft- Raft consensussqlparser- SQL parsingio-uring- Linux io_uring (Linux only)
MIT