rubyrep and postgresql replication roundup

No Gravatar

While replication might not be tightly integrated into postgresql at the moment, we are lucky to have a variety of tools.  Each one has different qualities and meets different needs.

SlonyII is mature and easy enough to implement, but it does not support multi master replication.  Bucardo and rubyrep handle that requirement and definitely have different personalities.  Bucardo is written in perl and rubyrep uses ruby, so you might pick the language with which you are more comfortable.

I had been impressed by how easy it was to get rubyrep up and running, but for some reason I missed it’s ability to handle continuous replication using triggers.  Luckily rubyrep’s author Arndt Lehmann set me straight with a comment to my misguided post.  We are currently implementing rubyrep to replicate a very large django database and I have been very pleased with the results.

I have noticed one interesting quick with rubyrep that we did not see with bucardo.  I’m still analyzing the situation and will submit a bug report to rubyrep or postgres.  I am using the same database backup to load the two databases to different servers.  I noticed that rubyrep was finding a huge amount of record mismatches regarding time/data data.  The only that was different between the two servers was the timezone.  One was set to UTC and the other Pacific.  Fixing the tz mismatch and restarting postgres has taken care of the problem.

While this would a problem going into production, rubyrep actually was able to sync these records very easily.  It painless synced the hundreds of thousands of records without breaking a sweat.  I was very impressed.

About edwin

I'm a web developer living in a post gis world. I’m interested in open source software, open data, GIS, spatial databases (geodatabases), web mapping applications and location based services. I love javascript (node!), python and postgresql.
This entry was posted in technology and tagged , , , , . Bookmark the permalink.

7 Responses to rubyrep and postgresql replication roundup

  1. AnonymouseNo Gravatar says:

    To IT Dept:

    add to your myrubyrep.conf:

    config.options[:database_connection_timeout] = 60

  2. IT DeptNo Gravatar says:

    we used ruby replication tool to replicate postgress DB, if the 2 servers are in the same location and network (192.168.1.0 it replicates , if the location and the network is diffrenernt 192.168.1.0 to 192.168.10.0 , it says uanble to connect. but we can telnet and ping between to networks

  3. edwinNo Gravatar says:

    Hello Prash,

    I’ve tested both on the WAN. I was actually really impressed with rubyrep’s performance when scanning and syncing hundreds of thousands of records. I’ll try to post some real performance results in the future.

    Unfortunately I haven’t been able to get rubyrep’s continuous mode to work when it can’t directly connect to each postgres instance. Our database servers are on internal networks in two different locations and we need to use an ssh tunnel to make the connection.

    Bucardo seems to work very well in this situation. I was able to do an 8000 record update very quickly over the WAN.

    Thanks very much for discussing this. I look forward to writing more about postgres replication, soon.

  4. hvprashNo Gravatar says:

    Was rubyrep and bucardo tested on multi-master WAN ? Which one is better?
    I tested rubyrep on WAN and it takes almost half an hour to sync an update of 10000 records in replicate mode with proxy. The total records that I am using for benchmark is 10000 Records with a latency between nodes of 40 – 45 ms.

    I am interested in comparing results.

  5. edwinNo Gravatar says:

    Hey Matt, that sounds about right. I do hope to get more of a wrap up written at some point. Thanks for reading and contributing! :)

  6. mattNo Gravatar says:

    So, in your experience bucardo and rubyrep are effectively accomplish the same goal with regards to multi-master setups, but bucardo required a significant amount of hacking to get online? Any plans for a comparison entry between bucardo and rubyrep?

  7. Pingback: iknuth » using rubyrep to replicate a postgresql database on ubuntu 9.10 (karmic koala)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>