Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose online backup api #144

Open
warmwaffles opened this issue Apr 15, 2021 · 10 comments
Open

Expose online backup api #144

warmwaffles opened this issue Apr 15, 2021 · 10 comments

Comments

@warmwaffles
Copy link
Member

This is an interesting page I ran across today and may be beneficial if we can figure out how best to expose the backup api

https://www.sqlite.org/backup.html

@warmwaffles
Copy link
Member Author

We can utilize the VACUUM INTO but the problem is, if the DBConnection uses it, the connection execution would time out.

@lawik
Copy link

lawik commented May 7, 2021

Have you looked at Litestream? I wonder if that runs on that API or other parts.
https://litestream.io/

I've been planning on setting up something to make sure Litestream runs to replicate Sqlite data as part of an Elixir application. I think doing what Litestream does, well, is probably challenging enough that I wouldn't bother porting it and would rather use it.

Just thrilled to have streaming backup for Sqlite :)

@warmwaffles
Copy link
Member Author

warmwaffles commented May 7, 2021

Yea litestream is cool, but what I was thinking about was something for embedded systems to utilize and backup stuff without being connected to the internet.

I am unsure of litestream's ability to run on micro controllers.

The other use case is just a periodic backup of a system that wakes up for a short period of time.

@lawik
Copy link

lawik commented May 7, 2021

I would expect litestream to do nicely in that case too (at least Raspberry Pi grade) but it does want something shaped like S3 to shove the file at and that implies an internet connection.

Just wanted to make sure you knew of it. If you have need of the Backup API, go forth :)

@lovebes
Copy link

lovebes commented Jun 14, 2022

litestream does allow backing up into a file. I know I'm chiming in here a year later - but yeah since one year, Litestream is really picking up some steam (core developer got hired by Fly.io to work on it fulltime!) :) It'd be awesome if exqlite supports this in-house so no additional dependency is added.

@warmwaffles
Copy link
Member Author

@lovebes I don't think there is anything we have to do directly. AFAIK, litestream just watches the write ahead log file to replicate changes. I don't think there is anything directly that we can do here.

@lawik
Copy link

lawik commented Jun 14, 2022

I think exposing any existing backup API can be smart. I’d suggest not introducing litestream which is another binary and a whole opinion on how to do backups into the low-level db library here.

There is already a package for running Litestream: https://hex.pm/packages/litestream

@lovebes
Copy link

lovebes commented Jun 15, 2022

Ah yes, I agree with the approach.

@joeljuca
Copy link

Posting here cuz it sounds related to the issue: apparently, SQLite released a new way to run backups, using a rsync-like algo that's probably on-topic here:

https://sqlite.org/rsync.html

@warmwaffles
Copy link
Member Author

@joeljuca I believe that is a standalone binary and not baked into the C interface natively. I'll need to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants