> I guess we have a different view of the reliability of sqlite
I also consider reliability as a project, rather than just as software.
The latter has been proven-enough, but the former could fail at any time (although I mentioned the mitigation caveat).
I also just don't really like the idea of storing large blobs in SQLite, the way it handles that is pretty bad in my opinion (and multi-DB support is *documented* flakey in a bunch of additional ways too). I spent a while investigating the various databases to see if it was practical (because I wanted to do it) and was rather disappointed even by the ones that handled it best (PostgreSQL has a bunch of dumb limitations that suggest it was implemented before they had partitioned tables and was never touched since).
The closest to a satisfying option I could imagine there (without changing a *lot* of its storage management model) would be to add an extension to SQLite that enables handling external blobs in the same transactions as internal storage (a lot more reasonable to do this with SQLite than PostgreSQL actually, since collocating the DBMS and the user simplifies a bunch of things).
That does constrain implementation languages to ones that can do FFI callbacks (or C) or at the very least require one such language for implementing that part.
> sqlite also provides indexing, which will be unavoidable for pruning old content, deduplicating blobs, finding files that actually changed, etc...
Yeah, all of that would need to be handled.
> You may 'pragma wal_autocheckpoint=0' to disable autocheckpointing in wal mode
Not quite what I had in mind. This still calls fsync at least once per transaction.
The not-completely-applicable PostgreSQL example I linked batches multiple transactions as a single unit to write out & sync, if they happen with a given timespan.
My idea was more like accumulating N chunks of changes (or up to M files if they're smaller) before committing any of that to disk.
