5 ms·
It's just a single file. Easier to backup than any other database. Also I don't think any cloud provider/database provides an always up to date backup other th
by hashhar 7y ago
It's just a single file. Easier to backup than any other database.
Also I don't think any cloud provider/database provides an always up to date backup other than a standby replica (which isn't also a backup exactly).
- wongarsu 7y agoIf I remember the "ways to corrupt SQLite databases" page discussed a few days ago, backing up SQLite isn't entirely trivial. By default there are up to three files that have to be copied simultaneously, else you risk corruption. The optimum is to run the backup command to create a copy, but that requires realizing this exists.
- hashhar 7y agoIf you do find the link could you please share it here. I think I've been hit by it once before. Also, it's comparatively simpler than other DBMS's like Postgres or MySQL.
- wongarsu 7y agoLink: https://www.sqlite.org/howtocorrupt.html https://www.sqlite.org/howtocorrupt.html Discussion: https://news.ycombinator.com/item?id=22098832 https://news.ycombinator.com/item?id=22098832
- hashhar 7y agoThanks. Useful information. But I've been copying after taking a shared lock on the sqlite db and I think that's supported as mentioned on https://www.sqlite.org/backup.html https://www.sqlite.org/backup.html. The online backup API is nice but it has to be done in-process or through a dedicated application. While the lock and file copy is very easy to do using whatever shell the OS provides.