On 6 Oct 2015, at 1:52pm, David Barrett <dbarrett at expensify.com> wrote:
> Well yes, but I'd like to handle it at the application layer. Basically, > we operate a custom replication layer atop sqlite. It replicates > individual transactions great with 2-phase commit, but right now you need > to manually "bootstrap" a new server by copying the database from a > different server. I'd like to auto-bootstrap a new node by just starting > it, it'd connect to a peer, and then download the entire database. Copy an existing /closed/ database file to the new server using file commands, [other connections trying to make modifications will, I think, get error messages] Or copy an existing /open/ database file to the new server using the SQLite Backup API, [requires other connections to stop modifying the database for long enough for the copy to be made] Or copy an existing /open/ database file to the new server by creating the new database using sqlite_open(), then ATTACHing the source database and using INSERT (SELECT ...) [locks other connections trying to use the source database out while copying is done] Simon.