# cmu-db/bustub

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/cmu-db-bustub).**

4,861 stars · 2,004 forks · C++ · mit

## Links

- GitHub: https://github.com/cmu-db/bustub
- Homepage: https://15445.courses.cs.cmu.edu
- awesome-repositories: https://awesome-repositories.com/repository/cmu-db-bustub.md

## Topics

`database` `dbms`

## Description

This is an educational relational database engine used in Carnegie Mellon University's database systems course. Students learn internals by implementing core components of a working database, including storage, indexing, concurrency control, and crash recovery.

The system covers key database architecture: a B+ tree index for fast key-based lookups and range scans, a disk-oriented buffer pool that caches pages from disk, an iterator-based query execution model that composes physical operators, page-based storage for records, two-phase locking for coordinating concurrent transactions, and write-ahead logging to ensure durability and recoverability after failures.

It also provides an interactive SQL shell for executing queries against a relational schema, concurrent transaction management with ACID guarantees, and crash recovery via logging and checkpoint techniques—giving students a complete hands-on environment for building and experimenting with database internals.

## Tags

### Part of an Awesome List

- [Database Internals](https://awesome-repositories.com/f/awesome-lists/learning/database-internals.md) — Teaches database internals by having students build core components like buffer pools, B+ trees, and query execution.

### Data & Databases

- [Concurrent Read-Write Transactions](https://awesome-repositories.com/f/data-databases/acid-transactional-cores/concurrent-read-write-transactions.md) — Coordinates multiple client operations to preserve data consistency with ACID properties and concurrency control. ([source](https://15445.courses.cs.cmu.edu/fall2022/))
- [Page-Based Storage](https://awesome-repositories.com/f/data-databases/file-based-storage-systems/page-based-storage.md) — Organises database records into fixed-size pages that are the unit of transfer between disk and buffer pool.
- [Two-Phase Locking Protocols](https://awesome-repositories.com/f/data-databases/migration-management/advisory-locking-mechanisms/two-phase-locking-protocols.md) — Coordinates concurrent transactions by acquiring locks in a growing phase and releasing in a shrinking phase.
- [Reactive SQL Query Execution](https://awesome-repositories.com/f/data-databases/reactive-query-engines/reactive-sql-query-execution.md) — Parses and executes SQL statements against a relational schema with support for multiple query types.
- [Educational Database Systems](https://awesome-repositories.com/f/data-databases/relational-database-management-systems/educational-database-systems.md) — Serves as an educational relational database engine for teaching internals through hands-on implementation.
- [SQL Query Execution Engines](https://awesome-repositories.com/f/data-databases/sql-query-execution-engines.md) — Parses and executes SQL statements against a relational schema to retrieve or modify data. ([source](https://15445.courses.cs.cmu.edu/fall2022/))
- [B+ Tree Indexing](https://awesome-repositories.com/f/data-databases/storage-engines/b-tree/b-tree-indexing.md) — Implements a B+ tree index for fast key-based lookups and efficient range scans.
- [Write-Ahead Logging](https://awesome-repositories.com/f/data-databases/write-ahead-logging.md) — Ensures transaction durability by recording changes to a log before writing data pages to disk.
- [Interactive SQL Executors](https://awesome-repositories.com/f/data-databases/sql-script-execution/interactive-sql-executors.md) — Provides an interactive command-line interface for executing SQL queries and viewing results in real time. ([source](https://15445.courses.cs.cmu.edu/fall2019/))

### Development Tools & Productivity

- [Database Crash Recovery](https://awesome-repositories.com/f/development-tools-productivity/crash-recovery-systems/checkpoint-based-recovery/database-crash-recovery.md) — Restores database consistency after crashes using write-ahead logging and checkpoint-based recovery. ([source](https://15445.courses.cs.cmu.edu/fall2022/))
- [Database Crash Recovery](https://awesome-repositories.com/f/development-tools-productivity/crash-recovery-systems/database-crash-recovery.md) — Restores database consistency after failures using write-ahead logging and checkpoint-based recovery.
- [Interactive Shells](https://awesome-repositories.com/f/development-tools-productivity/interactive-shells.md) — Provides an interactive command-line interface for typing SQL commands and viewing results in real time.

### Game Development

- [Database Query Execution Iterators](https://awesome-repositories.com/f/game-development/query-result-iterators/database-query-execution-iterators.md) — Implements an iterator-based query execution model that composes physical operators into a pull-based tree.

### Security & Cryptography

- [Database Concurrency Control](https://awesome-repositories.com/f/security-cryptography/row-level-security/concurrency-locking/database-concurrency-control.md) — Manages concurrent transactions with ACID guarantees through locking and isolation protocols.

### Software Engineering & Architecture

- [Database Buffer Pools](https://awesome-repositories.com/f/software-engineering-architecture/byte-buffer-pooling/database-buffer-pools.md) — Ships a disk-oriented buffer pool that caches pages from disk to minimize I/O operations.
