Write You a Vector Database is a short, Rust-first systems course. Build a small in-memory vector database in Rust, compare approximate results with exact search, and connect the resulting indexes to SQL through DataFusion.
The course focuses on the boundary where algorithms become database features:
in-memory table → DataFusion optimizer rule → IVFFlat → graph indexes
Instead of hiding vector search behind an HTTP API or an ANN library, the course exposes the algorithms, evaluation contracts, query planning, and execution boundary that make SQL vector search work.
The Rust course is available through Chapter 2: an Arrow-backed in-memory table and safe DataFusion optimizer rule, followed by IVFFlat. Both chapters include starter code, focused tests, SQLLogicTests, and separate completed reference crates.
Run the completed reference with:
cd rust
cargo test -p vector-core -p vector-datafusion
cargo run --release -p vector-core --example recallThe original C++/BusTub edition is deprecated and unmaintained. It remains online for existing readers but is no longer recommended for new learners.
Join skyzh's Discord server to study with the write-you-a-vector-db community.
The BusTub vector-db starter code and solution are under the MIT license. Some files overlap with CMU's Database Systems course and must not be made public. The author reserves the full copyright of the course materials, including Markdown files and figures.
