Take the 2-minute tour ×

I'm writing the model of database which is using the B+ tree datastructure. I know how to implement this structure on Java using only RAM. But I need to write data on the disk(each time when I write, modify or delete)

How can I implement this structure?

share|improve this question
You may be able to figure out the answer if you sift through the code for any of the open source databases like SQLite, CouchDB, etc. –  yasouser Dec 21 '10 at 20:41
add comment

2 Answers

up vote 3 down vote accepted

See if this is helpful: How does the file system store a b-tree?

share|improve this answer
add comment

I would recommend using a library. Writting BTree may look simple on paper, but with a few millions items and rebalancing it gets harder.

There is an BTree/HTree which stores its nodes on disk. It implements Map and Set interface. http://code.google.com/p/jdbm2/

New version of this library is under development at github: https://github.com/jankotek/JDBM3

share|improve this answer
add comment

Your Answer


