[pybsddb] Snapshotting / replicating bdb

Jesus Cea jcea at argo.es
Mon May 25 17:19:02 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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).

2. If you need to physically copy the data, use the "hotbackup"
procedure clearly explained in Berkeley DB documentation.

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
.                              _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBShq23plgi5GaxT1NAQI2+wP9FZQGjn8nYKFeTCjBxTWV6o/WDIPuEwJD
gMfTRML5UHZzN8ZK9k0MiTzxnbF1K9ow6v4NDcv0uB3dWKQ/I/WCYlRkjqXZUa1l
ZQRzje+st40KlDDH++X+5WCAqS5ppgPt4lN3zkE11v4mWKGOxzHmCDmG18Okkc61
ibJAsqndCC4=
=vzB3
-----END PGP SIGNATURE-----



More information about the pybsddb mailing list