sboxdb(Sandbox Database) is a distributed SQL database written in Rust, built as a learning project to explore how modern databases work under the hood — from storage engines and transaction systems (MVCC) to Raft-based replication and SQL query execution.
NB: Just for learning and experimenting db internals, not suitable for real-word use, and not optimized for performance.
- KV Storage:
- in memory based key-value storage
- add LSM based kv storage for OLTP
- add parquet based storage for OLAP
[x] buffer pool manager with lru-k replacer
- Replication: Raft-based replicated state machine
- no cluster membership config change support.
- Transactional Storage: transactional mvcc storage
- concurrency control with MVCC+OCC
- add Write-Ahead-Log support
- add ARIES recovery support
- Transactional access method:
- catalog related access methods
- tuple related CRUD access methods
- index based access methods
- raft-backed access methods
- SQL parser: A handcraft SQL parser without yacc/bison.
- Data Types: null, boolean, i64, double, utf-8 string
- SQL syntax:
BEGIN,COMMIT, andROLLBACK[CREATE|DROP] TABLE ...and[CREATE|DROP] INDEX ...UPDATE [TABLE] SET ... WHERE ...DELETE FROM [TABLE] WHERE ...SELECT ... FROM ... WHERE ... ORDER BY ...EXPLAIN SELECT ...SHOW TABLESCREATE DATASET ...
- Full reference at here
- SQL Execution Engine: Simple heuristic-based planner and optimizer supporting expressions, functions and
joins.
- Logical Planner
- Logical Optimizer
- Physical Planner
- Executors
- Function support
- sql logical test util
- Wasm for browser for fun, deployed at here
- Architecture: A high level architecture about sboxdb
- SQL reference: Detailed SQL syntax sboxdb supported
- Examples: The SQL examples sboxdb supported
- References: Materials used while building sboxdb
- Just - Task runner for project commands
- uv - Python package manager for the SQL Logical Test script generator