Michael, I just read through the Sqlite documentation and it seems rollback and master journal are always written to the disk. Below is the snippet from Section 3.0 on http://www.sqlite.org/tempfiles.html#tempstore :
The rollback journal, master journal, and statement journal files are always written to disk. But the other kinds of temporary files might be stored in memory only and never written to disk. Whether or not temporary files other than the rollback, master, and statement journals are written to disk or stored only in memory depends on the SQLITE_TEMP_STORE<http://www.sqlite.org/compile.html#temp_store> compile-time parameter, the temp_store pragma<http://www.sqlite.org/pragma.html#pragma_temp_store>, and on the size of the temporary file. Since it doesnt mention WAL files, I am not sure how they are managed. I think this leaves the only option of keeping all the 2 minute data in memory and then create a single transaction every 2 minutes to get it into the DB in one shot. Thanks Pankaj On Mon, Aug 30, 2010 at 6:20 PM, Black, Michael (IS) <michael.bla...@ngc.com > wrote: > Well...yeh...but you were complaining about the logs being written to your > flash...you gotta' pick your poison. > > If you keep only the temporary files in memory you should be OK. That's > what the compilation flag is for. > > Keeping your entire database in memory is probably on an option if it's > small. > > Do you grow your database forever? Or is there some limit to what you're > doing I assume? > > If you're happy with the 660 writes-per-day from your 2-minute transaction > than the previous solutions (WAL, synchrnous, -DSQLITE_TEMP_STORE=3) should > make you happy. You'll only stand to lose the 2-minute transaction which is > where you were when you started this thread. > > > Michael D. Black > Senior Scientist > Advanced Analytics Directorate > Northrop Grumman Information Systems > > > ________________________________ > > From: sqlite-users-boun...@sqlite.org on behalf of Pankaj Chawla > Sent: Mon 8/30/2010 7:21 AM > To: General Discussion of SQLite Database > Subject: EXTERNAL:Re: [sqlite] Sqlite on NAND flash devices... > > > > HI Michael, > > Thanks for the reply. Wont keeping things in memory lead to chances of > db getting corrupt especially in cases of power failure or device reboots. > I am not sure but since Sqlite is now used so frequently in embedded > devices > and most devices use flash memories how are these situations mitigated. > Are there are papers/best practices available that can help. It seems to be > that if we try to reduce NAND writes by doing things in memory we lose on > reliability and the way to increase reliability is to do frequent writes. > Is > that > a correct understanding? > > Thanks > Pankaj > > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users