B-Tree
A self-balancing tree data structure used by most relational databases for indexes. Keeps data sorted and allows searches, insertions, and deletions in O(log n).
What is B-Tree?
A self-balancing tree data structure used by most relational databases for indexes. Keeps data sorted and allows searches, insertions, and deletions in O(log n).
B-Tree is a foundational concept that sits in the Database Fundamentals area of system design. Engineers reach for it whenever they need to reason about real-world trade-offs in that space — not just for textbook correctness, but because real production systems at companies like Netflix, Amazon, and Google make these decisions every day.
If you want to go deeper than this definition — with diagrams, code, and a quiz to lock it in — work through the "B-Tree" lesson linked below. It walks through the why, the mechanism, the trade-offs, and how the giants actually use it in production.
Learn B-Tree in depth
Full interactive lesson with diagrams, code examples, real-world references, and a quiz.
Open the B-Tree lessonRelated lessons
Lessons that touch on B-Tree as part of a larger topic.
B-Trees
How B-trees work internally, why every database uses them, and what happens when nodes split
foundation · database fundamentals
Database Indexing
B-trees, hash indexes, composite indexes, covering indexes, the single biggest performance lever in any database
foundation · database fundamentals
Index Rebuilding
When your database indexes rot and queries slow to a crawl, how to fix it without taking the system down
foundation · database fundamentals
See also
Related glossary terms you might want to look up next.
Index
A data structure that speeds up database lookups. Like the index at the back of a book that lets you jump to the right page instead of reading every page.
Database
An organized collection of data that can be easily accessed, managed, and updated. The backbone of almost every application.
LSM Tree
Log-Structured Merge Tree: a write-optimized data structure that buffers writes in memory and periodically flushes sorted runs to disk. Used by Cassandra, RocksDB, and LevelDB.