On 20 Sep 2012, at 6:42am, Rojo James <rojoja...@gmail.com> wrote: > Is it possible to flush only the changed values from the in-memory database > to the hard-disk and not backup the whole database (may be using something > like a transaction log)? Is there some built-in function for this?
Keep a column in your table(s) called 'changed'. After you startup and have read the database into memory, set the 'changed' values in this memory copy to 0/FALSE: UPDATE myTable SET changed=0 When a row is changed set its "changed" to 1. When you are ready to flush memory look only at the rows with changed=1, write those away, then execute the above UPDATE command again. > Is it possible to have a disk based database, with the WAL file residing in > the RAM? In this case less IO cycles are required and the back-upping of > data to flash drive is simpler. There are ways to mess with the drive used for temporary files, and point it at a RAM drive. But that requires RAM drive support. I don't think you can define it as ":memory:". > What other possibility do I have to minimize the write cycles to the flash > memory? I think your idea of having a memory-based copy will work fine. And it has the advantage of being completely standard SQLite without requiring any weird coding or setup which another programmer might have trouble understanding. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users