Skip to content
/ sboxdb Public

Distributed SQL database in Rust, written as a learning project about my journey on the database and rust.

Notifications You must be signed in to change notification settings

maxnilz/sboxdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sboxdb

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.

Outline

  • 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, and ROLLBACK
      • [CREATE|DROP] TABLE ... and [CREATE|DROP] INDEX ...
      • UPDATE [TABLE] SET ... WHERE ...
      • DELETE FROM [TABLE] WHERE ...
      • SELECT ... FROM ... WHERE ... ORDER BY ...
      • EXPLAIN SELECT ...
      • SHOW TABLES
      • CREATE DATASET ...
    • Full reference at here
  • SQL Execution Engine: Simple heuristic-based planner and optimizer supporting expressions, functions and joins.
  • Wasm for browser for fun, deployed at here

Documentation

Dev Tools

  1. Just - Task runner for project commands
  2. uv - Python package manager for the SQL Logical Test script generator

About

Distributed SQL database in Rust, written as a learning project about my journey on the database and rust.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published