I have a Hash Map (many-to-one relationship between texts and boolean values):
name flag
---------------------
"abc" TRUE
"cde 12" TRUE
"foo" FALSE
"some text" TRUE
etc...
I need to persist this structure in Java application. This structure will be extended, but never changed. It means that I will add new records to it but never delete nor change existing ones. What is extremely important is the speed of search (I provide a name and it returns the flag). It may be really big in size (millions of records). There are a number of options I consider: 1) relational database with one table and one index, 2) flat file(s), 3) pure JVM database.. What would you suggest?
I’d recommend JDBM3 library which provides a disk backed HashMap and TreeMap implementations. Its fast, scalable and easy to use. Apache 2 license.
From the site:
JDBM has outstanding performance; it can insert a million records per second and read them even faster