Open Source Computing and GIS in the UK

Travels in a digital world

Database Replication

| Comments

Part of my fabulous new plans for portable gis (which will be revealed soon-ish) involve including a database replication option. This might or might not work on the USB drive, but it needs to be open source, portable, and connect to postgresql at the very least. I have been looking at a couple of options for this, without a vast amount of success, it has to be said.

The packages that I have tried are: Daffodil Replicator, dbreplicator (a fork of daffodil replicator), Symmetric-DS, and db -connector for Funambol. Of these, daffodil and dbreplicator seem like the best bet as they will attempt to do some conflict resolution (eg when the same record is added/altered in both databases). They are also java-based, so should be nicely configurable. Symmetric-DS works well, but doesn’t do conflict resolution, so that kind of rules it out for me. I don’t really know about db-connector for funambol as the documentation that I found was quite out of date and I didn’t get very far with it.

So, daffodil replicator and dbreplicator…

They are quite easy to set up, although the documentation in both cases assumes rather more end-user knowledge than perhaps they should do. Basically you find an appropriate jdbc jar file for your database, grab log4j.jar from somewhere, and tell daffodilreplicator/dbreplicator where to find it, by setting appropriate paths in batch files. Then you start the publication server and set up the details for your “master” database, and then do the same for the subscription server and the “client” database. Both are clever enough to translate between different database types, such as postgresql and mysql, which in some cases would be really handy.

My difficulty with both flavours of the package came when creating the “subscription”, ie telling the client database where to go find the master database. In neither case have I been able to sucessfully set this up, because of various errors. Weirdly, both flavours of the package give me an error in my log file about the first ever subscription that I tried to set up, despite having reinstalled, deleted everything I could find, and started from scratch several times.

The documentation in both cases hasn’t been good enough to resolve my issues, and neither have the forums. Actually, I’m still waiting on dbreplicator, which seems to be a little more active, so I should give them the benefit of the doubt for a couple of days.

I can see a great need for this kind of setup, assuming I can get around these initial teething troubles. So, my question is, has anyone successfully set up any of these packages on windows (sorry, but it needs to be windows at this stage), or does anyone know of any other packages I should try?

If I do manage to get things sorted I’ll post a detailed how-to…