8

Does anyone know where to find a B+Tree on-disk implementation? I went through google forward and backward and unfortunately I couldn't find anything sensible. Other threads have suggested to maybe take the tree from sqlite, sqljet or bdb but these trees are nested in the whole database and you can't really "just" filter out the B+Tree. I'm really looking for only a on-disk B+Tree... without any fancy things around.

Jonas
  • 121,568
  • 97
  • 310
  • 388
mkn
  • 12,024
  • 17
  • 49
  • 62
  • 1
    That's all I found - http://bplusdotnet.sourceforge.net/ - just because nobody answered so far and can't tell, if this is a on-disk implementation or if it can be adapted to be one. (It says '.NET' but there is a java implementation too!) – Andreas Dolk Jul 07 '10 at 09:56
  • thanks for your link! looks quite good. at least it has created some files on disk when I run the test tree file. I will give a feedback after having a deeper look into it. – mkn Jul 07 '10 at 12:51

3 Answers3

6

I've implemented disk-based B+-tree in the past. https://github.com/myui/xbird/blob/master/xbird-open/main/src/java/xbird/storage/index/BIndexFile.java

Find usage in https://github.com/myui/xbird/blob/master/xbird-open/main/test/java/xbird/storage/index/BIndexMultiValueFileTest.java

myui
  • 276
  • 4
  • 6
  • 3
    https://github.com/myui/btree4j/tree/master/src/main/java/btree4j Extracted as a solo b+-tree project – myui Mar 29 '19 at 06:17
6

There is a GDBM-inspired Java persistence engine: MapDB

Andrejs
  • 26,885
  • 12
  • 107
  • 96
Jonas
  • 121,568
  • 97
  • 310
  • 388
1

If you need it for real usage rather than for educational purposes (studying B+Tree data structure, etc.), LMDBJava is probably the best solution, available in Java now. It's not B+Tree exactly, but also a sorted key-value store, so practically the same as B+Tree.

leventov
  • 14,760
  • 11
  • 69
  • 98