Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-12 Thread Stephen Chrzanowski
If you write your information to the cheap* USB key instead of the SD card, from a mile-high view, you're looking at a bad data disk instead of a bad OS disk. You could backup daily your USB version of the database to the SD card, or to a network drive (If available) so then you're only writing

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-12 Thread Clemens Eisserer
Hi Stephen, > *First*, buy a bulk amount of cheap, inexpensive USB keys and start > throwing your data at the key instead of your OS's card. Don't see how that will change things: Once the SD card fails, data logging will fail too - same is true for the usb key. > *Second*, instead of writing

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-12 Thread Stephen Chrzanowski
There are a few reasons for the two-database method would be useful versus a single database connection, depending on the volume of data in the pot. 1> Having a single hourly database will keep the database size minimal. ~8000 entries holding just temperature data, it'll be small so I can't see a

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-12 Thread RSmith
On 2014/02/12 10:09, Stephen Chrzanowski wrote: The other thing I'd look into is that because of the varying speeds of SD, the volume of information you could be writing, you may run into an issue where you call the backup API but due to write speeds, something else writes to the live in-memory

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-12 Thread Stephen Chrzanowski
Three thoughts; *First*, buy a bulk amount of cheap, inexpensive USB keys and start throwing your data at the key instead of your OS's card. I'm not 100% clear on how a USB key handles itself as far as writing to certain parts of its memory, but you could partition off chunks of space and just

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-10 Thread Richard Hipp
On Mon, Feb 10, 2014 at 9:07 AM, Clemens Eisserer wrote: > Hi Richard, > > > In WAL mode, with synchronous=NORMAL (the default), fsync() only happens > on > > a checkpoint operation. Whether or not checkpoint is "very seldom" > depends > > on a number of factors, but seems

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-10 Thread Clemens Eisserer
Hi Richard, > In WAL mode, with synchronous=NORMAL (the default), fsync() only happens on > a checkpoint operation. Whether or not checkpoint is "very seldom" depends > on a number of factors, but seems likely to be the case in your scenario. Thanks a lot for your answer. Just to make sure,

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-10 Thread Richard Hipp
On Mon, Feb 10, 2014 at 8:40 AM, Clemens Eisserer wrote: > Hi, > > I would like to use sqlite for storing temperature data acquired every > 10s running on my raspberry pi. > As my first SD card died within a week with this workload, I am > looking for opportunities to reduce

[sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-10 Thread Clemens Eisserer
Hi, I would like to use sqlite for storing temperature data acquired every 10s running on my raspberry pi. As my first SD card died within a week with this workload, I am looking for opportunities to reduce write operations triggered by fsyncs to flash. For me loosing 1h of data at a power