key-value store suggestion

后端 未结 6 868

I need a very basic key-value store for java. I started with a HashMap but it seems that HashMap is somewhat space inefficient (I\'m storing ~20 million records, and seems t

6条回答
  •  天涯浪人
    2020-12-15 10:30

    Consider Koloboke Collections, which is up to 2 times faster than Trove according to various tests:

    • Time - memory tradeoff with the example of Java Maps
    • Large HashMap overview: JDK, FastUtil, Goldman Sachs, HPPC, Koloboke, Trove

    if configured to consume the same memory as Trove. Or alternatively, you can think it consumes considerably lesser memory if configured to be equally fast to Trove.


    If you want to persist the map between JVM runs with very quick bootstrap, you might also be interested in Chronicle-Map which stores Strings in UTF-8 by default (so you shouldn't bother with conversions String <-> byte[] as with Koloboke/Trove). Chronicle-Map is ultra fast for persisted key-value store, but a bit slower that Koloboke and even Trove.

提交回复
热议问题