3 ms·
> It’s also important to note that Litestream can’t resolve conflicts between multiple database writes, so each database can have only one application server wi
by orf 6y ago
> It’s also important to note that Litestream can’t resolve conflicts between multiple database writes, so each database can have only one application server with write access.
It’s cool, don’t get me wrong, but given the above constraint isn’t it just:
while True:
sleep(1)
upload_file(“sqlite.db”)
with extra bells and whistles?
- mtlynch 6y agoThanks for reading! Litestream is doing more magic than it seems, so it's much better than a naive while loop. Litestream is only streaming the changes in the database, whereas the naive implementation would have to upload the entire database every second. Also, SQLite has a write-ahead log, so you're not guaranteed that all the data is always in the main .db file. Litestream watches the write-ahead log files as well and immediately streams those changes to cloud storage. A system that only watches the main .db file would have long time windows where data loss is possible.