Question on database replication/backing up

18 views
Skip to first unread message

Sami Kujala

unread,
Jul 30, 2014, 3:52:01 AM7/30/14
to hamster...@googlegroups.com
Hello everybody,


I am experimenting with HamsterDB as a replacement of the persistence layer of a long-time hobby project of mine, basically an addressbook/membership database for a club. There are a few hurdles I need to pass before deciding on how to reimplement the persistence layer. It is now based on SQLite, but the data model is a bit cumbersome to be expressed in SQL.

One thing which I haven't been able to really figure out, is how to programmatically take backups or replicate the database in use. I know SQLite has the backup api ( http://sqlite.org/c3ref/backup_finish.html ) which is really appealing in its simplicity and I was hoping for something similar in HamsterDB as well. 

My question is: what would be the right way of replicating an environment which contains possibly several databases, which all are configured differently (different key size or key type and varying record sizes)? I would prefer to start the replication from the application itself, making it as easy as possible for the nonprofessional user. Is this possible?


best regards,

Sami

Christoph Rupp

unread,
Jul 30, 2014, 4:09:50 AM7/30/14
to hamster...@googlegroups.com
Hi Sami,

a "hot backup" API is on my list, but please don't expect it too soon. Thanks for pointing me to sqlite, i'll use their API as a reference.

To perform a backup, the following steps should be sufficient:
- make sure that all transactions are either committed or aborted
- flush the environment (ham_env_flush) - this writes all dirty buffers to disk
- then copy the file (and the journal files, if transactions or recovery is enabled) to the destination directory.

If you run into problems then please tell me and i'll look into it.

Best regards
Christoph



--
You received this message because you are subscribed to the Google Groups "hamsterdb User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hamsterdb-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages