While querying data is fast, it seems adding new records is extremely slow.
Having played around with the Phonebook example I was not able to insert more than 10 records per second.
Is there a way around this? My application would need to store about 1M records.
I have been thinking about this and my bet is that the bottleneck is on disk I/O.
Disk I/O after a write (or a commit in relational DB) is pretty much unescapable, because you need to make sure data is persisted and safe in case of a crash.
I am wondering who is faster. A relational database doing multiple inserts and commits in sequence or Space4J.
If you are really concerned about this speed, you can perform the disk I/O asynchronously, but the price is clear: you will not be sure when your write is persisted and safe in disk. After a crash, you will end up losing some past sucessful writes.
So two questions remain:
1) Is Space4J as fast as any regular relational database when it comes to muliple and consective inserts/commits ?
2) Is there a scenario where doing async disk i/o is actually desirable considering its cost?