Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommend a fast & scalable persistent Map - Java

I need a disk backed Map structure to use in a Java app. It must have the following criteria:

  1. Capable of storing millions of records (even billions)
  2. Fast lookup - the majority of operations on the Map will simply to see if a key already exists. This, and 1 above are the most important criteria. There should be an effective in memory caching mechanism for frequently used keys.
  3. Persistent, but does not need to be transactional, can live with some failure. i.e. happy to synch with disk periodically, and does not need to be transactional.
  4. Capable of storing simple primitive types - but I don't need to store serialised objects.
  5. It does not need to be distributed, i.e. will run all on one machine.
  6. Simple to set up & free to use.
  7. No relational queries required

Records keys will be strings or longs. As described above reads will be much more frequent than writes, and the majority of reads will simply be to check if a key exists (i.e. will not need to read the keys associated data). Each record will be updated once only and records are not deleted.

I currently use Bdb JE but am seeking other options.


Update

Have since improved query performance on my existing BDB setup by reducing the dependency on secondary keys. Some queries required a join on two secondary keys and by combining them into a composite key I removed a level of indirection in the lookup which speeds things up nicely.

like image 746
Joel Avatar asked Oct 08 '09 10:10

Joel


People also ask

How many days of fasting is recommended?

A water fast is when a person does not eat and drinks nothing other than water. There is no set time that water fasting should last for, but medical advice generally suggests anywhere from 24 hours to 3 days as the maximum time to go without food.

Why do doctors recommend fasting?

This allows the body to better metabolize food and can help patients lose weight. It may have other benefits, too, such as decreasing cancer risk, managing autoimmune diseases and even adding years to a person's life.

What are the 3 types of fasting?

There are three main types of fasts: calorie restriction, nutrient restriction, and seasonal eating.


2 Answers

JDBM3 does exactly what you are looking for. It is a library of disk backed maps with really simple API and high performance.

UPDATE

This project has now evolved into MapDB http://www.mapdb.org

like image 129
Andrejs Avatar answered Sep 24 '22 06:09

Andrejs


You may want to look into OrientDB.

like image 33
Juha Syrjälä Avatar answered Sep 22 '22 06:09

Juha Syrjälä