SQLite trusts the filesystem; the filesystem doesn't always deserve it
SQLite's concurrency model relies on the host OS's file locking primitives — fcntl(F_SETLK) on POSIX, LockFileEx on Windows. When those work correctly, SQLite is bulletproof. When they don't, you get corruption.
Networked filesystems are the worst offenders:
- NFS — file locks are advisory and often unreliable. Concurrent writes lose updates.
- SMB / CIFS — locking depends on client/server config.
- FUSE filesystems — depends entirely on the FUSE driver's implementation.
- Dropbox / iCloud / OneDrive sync folders — sync apps touch and rewrite files; never put a live database there.
Safe places to put a SQLite database:
- Local SSD on the machine running the writer.
- An ext4 / APFS / NTFS volume that's not network-mounted.
- A managed service that handles SQLite (Turso, Cloudflare D1) and abstracts away the storage layer.
Warning: Pippa's
~/pippa-db/ lives outside Dropbox specifically because Dropbox sync corrupted earlier iterations. The 'sync your database file via cloud storage' anti-pattern is one of the top corruption causes Dad has personally hit.