← Work

CMU Database Systems

2026

BusTub Database Internals

Implemented the core internals of a disk-based relational DBMS in C++, from buffer management and a concurrent B+Tree index to optimizer rewrite rules, the execution engine, and optimistic multi-version concurrency control, then tuned the query and index paths, placing 17th and 18th on the course performance leaderboards.

Tech stack
C++17 · Concurrent systems programming · Query optimization · Performance engineering
Operating context
Single-node disk-based relational DBMS · Four core components from storage to transactions · Performance work on the index and query paths
Architecture

Disk-based DBMS internals

Query pathAsync background I/OImplemented component
BusTub database system architectureA SQL client sends queries through the parser, binder, planner, and optimizer into the execution engine, where custom rewrite rules run in the optimizer. The engine coordinates with the multi-version transaction manager, which writes version metadata into the table heap, and reads data through a B+Tree index and the table heap. All page access flows through the buffer pool manager and an asynchronous disk scheduler to the disk manager and the database file. Highlighted components are implemented coursework and link to details below.BUSTUB DBMSSQL FRONT ENDEXECUTION +TRANSACTIONSACCESS METHODSBUFFER + I/ODISKSQL clientshell · testsParserBinderPlannerQuery execution and plan optimizationOptimizermy rewrite rulesQuery execution and plan optimizationExecution enginebatch pull model · joins · sort · windowMulti-version concurrency controlTransaction managerMVCC · OCC validation · GCConcurrent B+Tree index and access-path tuningB+Tree indexlatch crabbing · range scansTable heapslotted tuple storageBuffer pool and page infrastructureBuffer pool managerARC replacement · page guardsBuffer pool and page infrastructureDisk schedulerasync request queueDisk managerpage reads · writesDatabase filepages
Neutral components are the course-provided scaffold. Highlighted components are the parts I implemented, and each links to its record below. Per the course academic integrity policy, solution code is not public.

Implemented components

01

Query execution and plan optimization

Implemented the executor suite for the batch pull-based engine, then wrote the optimizer rewrite rules and hash-join fast path that finished 17th on the course query-execution leaderboard.

02

Concurrent B+Tree index and access-path tuning

Built a concurrent B+Tree index with latch crabbing, then tuned the read and write paths by removing per-traversal buffer-pool reads, comparison cost, and global-latch contention, finishing 18th on the course throughput leaderboard.

03

Multi-version concurrency control

Added optimistic multi-version concurrency control to the engine, with tuple version chains and undo logs, snapshot visibility, atomic write-write conflict detection, serializable commit validation, and garbage collection.

04

Buffer pool and page infrastructure

Implemented the buffer pool manager, an ARC page-replacement policy, an asynchronous disk scheduler, and RAII page guards that give every upper layer safe concurrent page access.

BusTub is Carnegie Mellon's teaching database system. The SQL front end, catalog, table heap, disk manager, optimizer framework, executor interfaces, and test harness are provided by the course, and the records above are the components I implemented on that scaffold. Solution code stays private under the course academic integrity policy, so this page describes the work at the level of the public project specifications.