PalDB | An embeddable write-once key-value store written in Java | Key Value Database library
kandi X-RAY | PalDB Summary
kandi X-RAY | PalDB Summary
An embeddable write-once key-value store written in Java
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Copies the specified array of keys and values
- Get the data stream for the specified keyLength
- Get the index stream for a given keyLength
- Writes an array of bytes
- Closes the writer
- Closes the temp folder
- Write the metadata
- Build the index file
- Deserializes this instance from an input stream
- Deserialize this class
- Get the representation of this Version Version
- Writes a string
- Get version from byte array
- Reads a String from the stream
- Closes the reader
- Closes the reader channel
- Compares two configuration objects
- Checks if the given serializers are equal
- Get the prefix for the PALDB version
- Clear all serializers
- Creates a temporary directory
- Formats the created timestamp
PalDB Key Features
PalDB Examples and Code Snippets
Community Discussions
Trending Discussions on PalDB
QUESTION
I'm currently implementing a solution for one pretty old system, which needs a lightweight key-value file-based (a value for a key is stored as a file) storage with simple ConcurrentHashMap-like operations: put(), delete(), get() and listAll() operations. It has to privide an ability to have concurrent read and write operations with a fully-featured transactional behavior (ACID + repeatable read isolation).
Seems like this component should look pretty similar to the TableFS...
ApproachAn initial idea is to take a lightweight embeddable persistent key-value storage and use it to store a metadata for the value files located in a file system (file key, file path, size, other attributes...). Also, it should provide a quick file searching engine, based on indexes. So that, such storage plays a role of a register...
I have been searching for quite a while for such the key-value storage that can meet the following requirements:
- Open source;
- Embeddable;
- Provide a support for Java maps and collections;
- Machine crash/power-off tolerance (write-ahead logs and other approaches);
- Providing ACID transaction;
- Being a read-write storage (comparing to the read-only PalDB).
and came up with the MapDb and LevelDb options.
As far as I need to ensure the concurrency resolution for those read/write user transactions, I need to establish global XA transactions, involving the key-value storage and a file system. For the file system there are the XADisk and Jakarta Commons-Transactions transaction systems, also for the global archestration there is the Atomikos Essintials transaction manager.
However, I cannot find any article that explains how to configure the MapDB or LevelDB with an XA transaction manager...
QuestionsCould you please suggest on the following?
- whether my approach makes sense or there are some well-known solutions/implementations for the described problem?
- what pitfall can you see in this task/approach?
- are there any resources that describe how to configure such key-value storages for participating in xa transactions?
There is another database - SQLite - which can be integrated with Atomikos. It does not mimic Java collections, but it is pretty easy to emulate all the opeations manually. The only pitfall that I can see for now, is the way of resolving concurrent key modifications by concurrent transactions (lost update problem). Seems like there would be a requirement of writing a kind of stored procedure with the test-and-set feature based on a key's timestamp...
...ANSWER
Answered 2017-Apr-26 at 08:06Ok, finally, I worked out an idea for implementing my task, even without XA transactions, file locks and other over-complications.
If somebody is interested, please have a look at my project at GitHub, following this link. The description would be added soon to the GitHub project. Hope, for now, the code is self-explanatory.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PalDB
You can use PalDB like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the PalDB component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page