Persistent hashtable (to use with Java) [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this questionI want to use a persistent HashTable to provide data storage for my application. Is this possible. A large well supported open-source project would be ideal.
You have 2 options :
a) Seralize your Hashtable to file -- after all the Hashtable class implements Serializable.
b) BerkeleyDB Java Edition -- you can download this for free from Oracle. It is open source. Berkeley DB database is a b-tree. It is fairly straight forward to convert your code from HashTable to Berkeley DB .
Note that if you use simple Hashtable for storing your objects, you will run out out memory when the number of obects in Hashtable increases beyond a certain number. With Berkeley DB, there is no such limitation.
Chronicle Map is an off-heap key-value store for Java, providing ConcurrentMap
interface and (optionally) persists data to disk. Under the hood, it's implemented via memory-mapped files.
精彩评论