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

Advice on taking backup? #20

Open
trygve-lie opened this issue Oct 2, 2014 · 4 comments
Open

Advice on taking backup? #20

trygve-lie opened this issue Oct 2, 2014 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@trygve-lie
Copy link

How do you guys and girls take backup of your level db data?

Do you (A) just copy out the files level create on disc or do you (b) implement a export feature which dumps all data in the database to file for later import?

If A: How does this work with having the db open by the running node program? Do you close down, backup and then open the database again or do you just copy out files wile running?

If B: Do you export all data every time or do you do diffs? If the database is large, how much would a full export slow down the other operations?

Or do you simply do more advanced stuff where you write to multiple databases on different machines (in different data centers) and look at that as backup?

Maybe we are missing some backup modules for level. At least there should be some advice on how to backup / avoid data loss in the documentation I think.

@dominictarr
Copy link

I havn't really done this my self because the stuff that I happen to have done could all be rebuilt from scratch, but I think copying all the files would work, or you could use a data replication module.

@dominictarr
Copy link

there could be some edge cases around copying the files if a compaction is currently underway...
but I think this wouldn't be a problem if you snapshot the files (fs.readdir) and then copy those.
especially if you copy the manifest file, the sst files, and then the log files.

@ralphtheninja
Copy link
Member

@trygve-lie You can use level-hyper and do liveBackup(). Currently this is poorly documented, but I'm working on fixing that. Check level-test for an example of what this might look like. So the idea with liveBackup() is to be able to create backups without needing to close the underlying db.

@ralphtheninja
Copy link
Member

Maybe we are missing some backup modules for level. At least there should be some advice on how to backup / avoid data loss in the documentation I think.

Amen.

@ralphtheninja ralphtheninja transferred this issue from Level/levelup Dec 17, 2018
@ralphtheninja ralphtheninja transferred this issue from Level/level Dec 21, 2018
@vweevers vweevers added the documentation Improvements or additions to documentation label Jan 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants