Berkeley DB would be the best choice probably but I can't use it due to licensing issues.
Are there any alternatives?
A key-value database is a type of nonrelational database that uses a simple key-value method to store data. A key-value database stores data as a collection of key-value pairs in which a key serves as a unique identifier. Both keys and values can be anything, ranging from simple objects to complex compound objects.
A key-value pair is the fundamental data structure of a key-value store or key-value database, but key-value pairs have existed outside of software for much longer. A telephone directory is a good example, where the key is the person or business name, and the value is the phone number.
When to use a key-value database. When your application needs to handle lots of small continuous reads and writes, that may be volatile. Key-value databases offer fast in-memory access. For applications that don't require frequent updates or need to support complex queries.
DynamoDB is a key-value store with added support for JSON to provide document-like data structures that better match with objects in application code. An item or record cannot exceed 400KB. Compared to MongoDB, DynamoDB has limited support for different data types.
You can try Hazelcast. Just add hazelcast.jar to your classpath. And start coding
java.util.Map map = Hazelcast.getMap("myMap");
You'll get an in-memory, distributed, dynamically scalable data grid which performs super fast.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With