Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.07 KB

File metadata and controls

45 lines (33 loc) · 1.07 KB

rust_db

ferrite

a minimal database written in rust from scratch

features

  • b-tree indexing for fast lookups
  • write-ahead logging for crash recovery
  • sql parser (select, where clauses)
  • binary serialization with bincode
  • persistent storage

demo

assets_demo.mov

how it works

b-tree indexes

  • o(log n) lookups vs o(n) table scans
  • automatically used by executor when available
  • supports range scans

write-ahead log

  • all writes logged before applying
  • replays on startup for crash recovery
  • checkpoints every 100 operations
  • prevents data corruption

storage

  • tables stored as hashmap<row_id, row>
  • binary serialization with bincode
  • indexes stored alongside tables

architecture

query → parser → ast → query plan → executor → storage
                                        ↓
                                   btree index
                                        ↓
                                   wal → disk