0

I'm still looking for Java Collections that are persistent and have comparable access times for performance. The Real data should stay on the disk but for faster access times I need a cache in the RAM so I can stream the content from the file to the main memory.

I read about h2 have such a cache function. Is there a option to cache the whole file on start up?

And can somebody say something about the performance? Currently, I have more than 100.000 items in a Java HashMap (key value is custom class which contains a byte array).

Thank you!

Community
  • 1
  • 1
501 - not implemented
  • 2,638
  • 4
  • 39
  • 74
  • Given sufficient work and tolerance for sufficient differences, almost any storage system can be used as an alternative to java collections. – Raedwald Jun 08 '16 at 13:53
  • Maybe you don't want to use anything else than H2, but you could look at http://infinispan.org/ – iXô Jun 08 '16 at 13:54
  • 1
    This answer might also give you some good hints although it is from a while back: http://stackoverflow.com/questions/8575723/whats-a-good-persistent-collections-framework-for-use-in-java – uniknow Jun 08 '16 at 14:06
  • my main fear is, that a alternative have lower performance than a java collection – 501 - not implemented Jun 08 '16 at 14:09
  • This is probably also interesting for you: [largecollections - a fast and persistent cache](http://www.bigsynapse.com/largecollections-a-fast-and-persistent-cache) – uniknow Jun 08 '16 at 14:44

1 Answers1

0

Partially. The H2 MVStore can be used as a persistent java.util.Map. But not as a list, stack, or so. The H2 Database is a relational database, with SQL and JDBC API, and with the latest version uses the MVStore as the default storage engine.

Other projects such as MapDB support similar features than the MVStore.

Thomas Mueller
  • 48,905
  • 14
  • 116
  • 132