0

Recently I started playing with MapDB, and learning about its interesting properties. As I understand now, it has three major data types: BTree, Hashmap and Hashset. Something which is a little obscure to me is that, when it is better to use Hahsmap (and Hashset), than using Btree? Any pros and cons in using each data structure compared to the other?

Daniel
  • 5,839
  • 9
  • 46
  • 85

1 Answers1

1

In 1.0 HashMap is better for larger keys, it also has entry expiration based on TTL or maximal size. TreeMap is sorted and has data pump.

I would recommend HashMap in general.

Jan Kotek
  • 1,084
  • 7
  • 4
  • From the docs: "This map is suitable for number of records 1e9 and over. Larger number of records will increase hash collisions and performance will degrade linearly..." Does this mean we are or are not recommended to use more than a billion keys? – approxiblue Nov 20 '14 at 16:40