@ccs-hello said in How to estimate actual flash memory wear caused by SQLite3?:
Very much depend on the P/E pattern (for a database which needs to store critical information.) If a specific file or a variable needs to be updated constantly, that sector will wear out fast.
I don't think that there is a direct file to sector mapping in JFFS2, so writing the same file (or part of file) 100'000 times will not write the same flash sector 100'000 times. It will cause 100'000 write operations of the size of the written data, but spread somehow (ideally: evenly) over the total of available flash blocks. That's what wear leveling is all about.
The question is just how near (or far) the wear leveling strategy in JFFS2 is from really even distribution of writes, in actual practice.
If that is the subject, now the question is how to deal with the it...
(1) specialized hardware (that has indexing, write cache, TRIM, relocation capabilities) <-- that is what the SSD is designed for
In general, yes, but the scope of my question is limited to the situation as present on a Omega2 (or similar), which is SPI NOR flash driven by JFFS2. The chip+JFFS2 are the "SSD" in an Omega2.
(2) software based, i.e., do it in RAM (enough RAM space allocated?, write-back before power is removed?, etc. etc.)
That's an important point. But AFAIK there is no internal mechanism in a MT7688 for powerfail writeback, so, as nice as this would be, we don't have that (or it would need to be built around the Omega2 with extra hardware).
So the context for my question is really actually written-back-to-flash SQLite3 transactions and their impact on flash wear.
Of course, my application already does as much buffering and pooling as possible in its intended use case, to minimize writes. But it boils down to these few hundred single SQLite table row updates per day with ~50 bytes of net change each.
I.e., there is no free lunch, use the right tool for the tasks at hand
I'm not asking for a free lunch ;-)
I'm just trying to figure out if the current lunch recipe might lead to a worn out flash too quickly or not...