Show in graph
DB

Software → Databases

B-Tree

A balanced tree data structure commonly used for database and filesystem indexes.

Motivation

A B-Tree solves the problem of indexing large datasets on disk while minimizing slow disk reads.

Where it fits

It belongs to databases and data structures and is a common foundation for relational database indexes.

Mental model

A B-Tree is a wide, balanced search tree. Each node stores many keys so fewer disk pages are needed during lookup.

Important details

B-Trees are optimized for block storage. They support range queries well and keep data sorted.

Common mistakes

  • Thinking B-Trees are just binary search trees.
  • Ignoring the disk/page motivation behind their shape.