[pybsddb] Snapshotting / replicating bdb
Jon Dyte
jon at totient.co.uk
Fri Jun 12 21:34:23 CEST 2009
On Monday 25 May 2009, Jesus Cea wrote:
> Cameron Simpson wrote:
> > I would point out, in case it wasn't made clear in an earlier post, that
> > like copying filesystems, copying database files shoud be surrounded by
> > some sort of sync function:
> >
> > db.freeze()
> > ...copy/snapshot the db...
> > db.unfreeze()
>
> This is a good advice in general. But current databases have procedures
> to do a hot-backup in a safe way, simply because you can not stop
> database operations for the hours it take to copy a multi-terabyte
> database environment.
>
> Working with BerkeleyDB, you have a couple of options:
>
> 1. Working with snapshots+cloning (ZFS), I simply clone the database and
> then do a database recovery over the clone. Of course the BDB
> environment must be transactional. This is very fast. And safe (if the
> database is transaction protected).
>
Jesus
Just to be clear are you saying you do the ZFS clone within a berkely db
transaction, or that providing the database is transactional, the ZFS clone
can be performed any time and the recovery procedures will guarantee the
consistency of the data. I think you mean the latter but I just wanted to be
sure.
Thanks
Jon
More information about the pybsddb
mailing list