B-Trees and Databases
For years Iâve always known that B-Trees were used in databases, but until I snatched a copy of Principles of Database Systems (printed in 1982) I didnât really understand how. The book breaks down how data is physically stored on a system and builds on that concept to illustrate how databases work. To keep things brief, records are basically their own data structure and indexes are systems of efficiently providing access to them, and what really struck me is in thinking about it that way that B-Trees really are not implicitly the best data structure for a Database. The tradeoffs really arenât worth it unless you have large volumes of hierarchical data. So in saying that, I think we need to think more about our data and our applicationâs relationship with it when weâre designing software. Because it could very well be that an off-the-shelf database system wouldnât be as performant as a hash-based system you rolled yourself.













