One Apple platforms, you also want to use F_FULLFSYNC instead of fsync if you need durability:
https://www.sqlite.org/pragma.html#pragma_checkpoint_fullfsy...
https://www.sqlite.org/pragma.html#pragma_checkpoint_fullfsy...
I am happy to lose 5 or 10 seconds of data in a power failure. However I'm not okay with a file becoming so corrupted that it is unmountable when the power recovers.
Half arsed fsync provides exactly that - and considering you get way more performance this seems like a good tradeoff.
I wish Linux and windows would have settings to change all fsyncs to barriers too.
Unfortunately I think Linux recently removed such an ability on the basis the code complexity wasn't worth it.