A simple OLTP relational database system implemented in TypeScript.
- Storage Engine: Fixed-size pages (4KB), Heap File organization, Buffer Pool Manager.
- Indexing: B+Tree index implementation.
- Transactions: ACID properties with 2PL (Two-Phase Locking) and WAL (Write-Ahead Logging).
- SQL Engine: Basic SQL parser and executor supporting CREATE, INSERT, SELECT, UPDATE, DELETE.
- Recovery: Crash recovery using WAL replay.
- Server: Entry point, handles REPL.
- SQL Layer:
ParserandExecutor. - Transaction Layer:
TransactionManagerandLockManager. - Access Methods:
Table(Heap) andBPlusTree. - Buffer Manager:
BufferPoolmanagingPages. - Disk Manager: Handles file I/O.
- WAL:
LogManagerandLogRecovery.
- Node.js
- npm
npm installnpm startnpm testCREATE TABLE users (id int, name string)
INSERT INTO users VALUES (1, 'Alice')
SELECT * FROM users WHERE id = 1