> add an extension to SQLite that enables handling external blobs in the same transactions as internal storage
In this specific case it is ok to write blobs, then if it's succeful to write the metadata, because the existence of a blob doesn't mean anything. I wouldn't explore any smarties for a backup program, but I'm curious as to what are the problems of storing them in db.
> 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.
This is what pragma synchronous is about
https://sqlite.org/pragma.html#pragma_synchronous
> In WAL mode when synchronous is NORMAL (1), the WAL file is synchronized before each checkpoint and the database file is synchronized after each completed checkpoint and the WAL file header is synchronized when a WAL file begins to be reused after a checkpoint, but no sync operations occur during most transactions