0

I have to store more than 100 millions of key-values in my HashMultiMap (key can have multiple values). Can anybody help me, is this possible to implement using Java-MongoDB ? Is the performance of MongoDB approximately identical to in-memory hash map ? Pointer to some nice tutorial about how to create and maintain HashMap in MongoDB is also helpful to me.

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
Arpssss
  • 3,850
  • 6
  • 36
  • 80

1 Answers1

0

Again, I don't know how is your HashMultiMap is going to work, but in MongoDB you basically store objects in JSON (enhanced binary JSON, technically speaking).

So your document could look like this:

{
  key1: [value1, value2, value3, ...],
  key2: [value1, value2, value3, ...],
  ...
}

If that's gonna work for you - great.

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
  • Yah, I exactly want that structure with high performance in insertion and search for key. Is MongoDB a nice one than others ? – Arpssss Mar 31 '12 at 04:25
  • Can you kindly inform from where I should start ? Actually, I want HashTabale/BTree for that and using Java. – Arpssss Mar 31 '12 at 04:27
  • If you store one key per document than searching will be great. Insert performance [might be not as great](http://www.mongodb.org/display/DOCS/Padding+Factor), but should be good. – Sergio Tulentsev Mar 31 '12 at 04:27
  • You start by downloading MongoDb and beginning to code :) Oh, and reading docs is also important. – Sergio Tulentsev Mar 31 '12 at 04:28
  • Sorry, is it nice for solving this (http://stackoverflow.com/questions/9930347/multimap-space-issue-guava).. From your experience :) – Arpssss Mar 31 '12 at 04:36