On Wed, Mar 05, 2008 at 09:02:17PM -0500, James Kimble wrote: > > > One thing I can highly recommend on embedded systems, especially flash > > based ones, is turn pragma synchronous to off. Having sqlite write every > > record modification to the flash, is a stunningly expensive process, > > even when it's all encapsulated in a large transaction. Let linux handle > > the synchronisation and write caching for you. A lot less robust, but, > > the benefits more than outweighed the cost. If you need guaranteed write > > to disk, then perform the synch yourself. > > > Cost vs benefit and all that guff. > > > That's sounds like good advice. I'll do that. > > Working with flash in this way is going to be a challenge. With limited > number of writes in a lifetime (this device needs to last approx 20 > years...) I will have to make some major design decisions around how > I handle the writes.
How important is the persisent data? Is it kept for audit, statistical analysis, what? Basically, can you afford to lose it, or at least a subset of it? If so , then I'd say maintain the data in an in-memory database, and write out the data to disk (using safe synchronous writes) at whatever intervals you desire. I say use safe synchronous writes, as recovery may be an issue if you don't write safely. Not what you need on an embedded system where user interaction may be required. Christian _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

