3 ms·
Thanks 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
by mtlynch 6y ago
Thanks 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.