I'm using a sqlite database with sqlalchemy in a python web app. I'd like to periodically back up the database by copying the file to blob storage. Obviously I can just copy the file, but I figure this'll lead to a corrupted backup if a write operation occurs while the file is being copied.
One approach is to acquire a file lock everywhere in my application that writes to the DB. But that's a bit error prone. Any recommendations?