News for hackers. Stuff that matters.
Re:SQLite is not a toy database by tmountain on Thursday March 25, 2021 @12:06PM (#26581972)
How do backups work? Is there a locking mechanism to prevent file corruption if the file is copied during writing?
Re:SQLite is not a toy database by sangnoir on Thursday March 25, 2021 @12:27PM (#26582241)
It supports multiple readers, and writes are atomic - no reader should ever get corrupt data just because there is a write happening in parallel. You probably should not use the OS to copy the live db file, rather, have an in-process thread that reads the db and writes to a backup location periodically.
Re:SQLite is not a toy database by mrweasel on Thursday March 25, 2021 @12:51PM (#26582551)
Exactly, many forget the little detail that they should use the backup feature, rather than just copy the database file.
Re:SQLite is not a toy database by nijave on Thursday March 25, 2021 @03:36PM (#26584445)
You can also combine file system snapshots to get versioning which would allow you to pull the db file out of the latest snapshot (right after taking it) and send it somewhere