key-value store suggestion

后端 未结 6 869

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:21

    Use Berkeley DB.

    Berkeley DB stores object graphs, objects in collections, or simple binary key/value data directly in an a btree on disk. This simple, highly efficient approach removes all the unnecessary overhead in ORM solutions. Using the Direct Persistence Layer (DPL) Java developers annotate classes with storage information, much like JPA. This approach is familiar, efficient, and fast. The DPL reduces the complexity of data storage while not sacrificing speed.

    This should definitely give you huge gains in memory and speed, while not increasing the complexity of your application. Enjoy!

提交回复
热议问题