I'm developing an embedded system, which needs to store and retrieve data very frequently. I am expecting perhaps 100s of writes per second and 10s of reads. The data will arrive in bursts rather than continuous.
I would like to use SQLite to store all this data, but since it is a flash file-system, the writes (INSERTS & UPDATES) are much too slow. I tried setting synchronous=off and this does certainly improve the performance, but I am nervous about corrupting the database.
In my application, power failures would be a rare, but real possibility. I can live with losing some recent data, but absolutely cannot risk losing all the data due to a database corruption.
I also thought about using an in-memory SQLite database as the primary database and periodically sync it to the file-system as discussed in Synchronizing sqlite database from memory to file
Are there any other options I should consider?