6

I'm looking for a persistent key-value storage to use in my application. Specifically:

  1. It must be embeddable into Java application. Pure Java solution would be the best.
  2. Data must be persisted on disk, in-memory-only storage is not an option. Memory footprint size is important and overall size of key-value map can be quite large. Ideally I'd like to have some kind of LRU cache implemented over the storage.
  3. Both keys & values are strings (don't need to support Java object serialization, etc).
  4. Concurrent reads/writes are important.

What would be the best option in such case?

andrew.z
  • 1,039
  • 3
  • 15
  • 24
  • possible duplicate of [key-value store suggestion](http://stackoverflow.com/questions/6639080/key-value-store-suggestion) – Basil Bourque Jul 23 '15 at 08:57
  • There is another way if it helps, use TayzGrid as a [java key value store](http://blogs.tayzgrid.com/using-an-in-memory-key-value-store-to-scale-java-apps/) and dump the cache data periodically – Basit Anwer Sep 08 '15 at 12:42

4 Answers4

5

OrientDB (SO info page) seems to fit the bill.

The documentation is occasionally a bit lacking, but I belive it fulfills the criteria you are listing.

Community
  • 1
  • 1
Henrik Aasted Sørensen
  • 6,966
  • 11
  • 51
  • 60
3

I do not know it is best or not but Hazelcast has these options. You can store your data on memory with a backup on disk. There is an example on hazelcast.

bhdrkn
  • 6,244
  • 5
  • 35
  • 42
3

I have used Voldemort when we had to replace normal HashMap when large data had to be supported. Performance was really great.

value = store.get(key)

store.put(key, value)

store.delete(key)

In next oppurtunity to try a key-value store, I will in all probability try out Redis

Community
  • 1
  • 1
rajesh
  • 3,247
  • 5
  • 31
  • 56
2

I would use SQLite (SQLite). It is a relational-database like file storage, that will allow you to store key-values and any other thing you may need. It has a very low footprint and is quite fast.

It is very commonly used on Android applications for all these reasons.

Calabacin
  • 725
  • 2
  • 8
  • 19