Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a disk-bound b-tree example

Maybe my google-foo just isn't up to snuff, but I'm wanting to play with a b-tree alogrithm that is bound to disk. Since most tutorials and examples are on-memory, they assume random access memory in which changing nodes in a tree is simple enough, but other than rather I/O intensive rewriting or using memory-mapped files, I can't think of a good approach.

Theory would be fine, C# or Java would be even better.

EDIT: I apologize for the lack of clarity. I am not looking for a product or code base to use, but an example or illustrative codebase to better understand how one would go about building a disk-backed b-tree.

like image 476
Arne Claassen Avatar asked Oct 25 '22 10:10

Arne Claassen


1 Answers

One of the fastest Key Value DB (which also contains a Key Value DB which works with B+Trees) is Tokyo Cabinet (or Kyoto Cabinet) :). I have worked with it when I was benchmarking B+Trees and the code is easy to understand. It's written in C but it has also Java bindings... Tokyo Cabinet: http://fallabs.com/tokyocabinet/

And Berkley DB also works with a B+Tree. However, when I was benchmarking Berkley DB, it was very slow compared to Tokyo Cabinet though... http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html

like image 186
mkn Avatar answered Oct 27 '22 11:10

mkn