I'm creating a Desktop Java application which needs to store (what could become) reasonably large amounts of data. I initially thought-up my own format:
id;name;value,value,value...
id;name;value,value,value...
To be stored as plain text and read/written randomly. My initial thoughts were to use RandomAccessFile; however, I encountered the problem of data being overwritten, when inserting in arbitrary positions.
Using the method of shifting the existing data along, storing it temporarily, restoring it, etc, seems like a bad solution, particularly because I intend to read/write quite often, so it would become expensive. I have read that this is a limitation of the underlying OS rather than Java itself.
What would be the best way to neatly store such data for frequent access and writes? Using SQLite crossed my mind. I've also thought of perhaps creating one file per id/name, since data values will only be appended to the end for each, hence nothing will be overwritten.