1. Computing

A Small Furry Database

By December 15, 2009

Follow me on:

Back 20 or so years ago before SQL databases became popular on microcomputers, B-Tree type databases were the in thing. A B-Tree is a data structure that holds data in pages in a tree structure. The B means balanced not binary. Binary trees are tree structures with just two branches per node whereas a B-tree isn't so restricted. As data is added to a b-tree, pages are split to maintain the balance. Generally all data is held in the same depth.

You can see an example of a C++ class to maintain a B-Tree. Even in some SQL databases, a B-Tree structure is used to hold the data internally . A good example of an embedded DB (ie one that links into your code rather than running as an external server) written in C is HamsterDB, a cross platform. Dual licensed under GPL or commercial license.

Note for non SQL DBs the approach to using the DB is quite different than that of SQL. It's more about retrieving records using a matching key and then doing updates or retrieving data. HamsterDB comes with a number of example programs to get you up and running. At my last job, the database there was Faircom's C-Tree and it was also a B-tree type database though commercial not open source. These types of databases are very fast but much better suited to single user rather than multi user applications.

Comments
Comments are closed for this post.
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.