finds.dev← search

// the find

skyzh/write-you-a-vector-db

★ 762 · C++ · updated Jan 2025

A Vector Database Tutorial (over CMU-DB's BusTub system)

A hands-on tutorial that walks you through adding pgvector-like capabilities to BusTub, CMU's educational database system. You implement vector storage, KNN scanning, IVFFlat, NSW, and HNSW indexes from scratch in C++. It's for developers who want to understand how vector databases actually work at the storage and index layer, not just use one.

The progression is well-sequenced — flat KNN scan first, then IVFFlat clustering, then NSW/HNSW graph indexes — so you build intuition before complexity. The diagrams for NSW and HNSW insertion and traversal are genuinely good; they make the graph construction algorithm click in a way most blog posts don't. Building on BusTub means you're working in a real query executor with real SQL logic tests (the .slt files), not a toy harness. The author (skyzh) also built RisingLight and has actual database internals credibility.

The Rust version is still a tracking issue with no code — if you came here for Rust, you're out of luck. The solution branch is a git submodule that isn't public, so you can't check your work without joining the Discord and hoping for community feedback. Last meaningful push was January 2025, and the 762 stars suggest it never broke out of niche database-internals circles. There's also no discussion of persistence or durability — you're implementing indexes purely in-memory on top of BusTub's existing storage, so what you learn doesn't transfer directly to production vector DB design.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →