views:

45

answers:

1

I'm working on a Ruby on Rails/PostgreSQL web app that a mobile device communicates with. The mobile device has the ability to post to a primary server and geographically redundant secondary server at the same time. I would to replicate my user and profile data from the primary server to the secondary server instantaneously. Is ActiveResource the preferred choice for this? Is this better done at the Rails level or PostgreSQL level? I'm wide open to any ideas to make this as reliable and low maintenance as possible.

Thanks, Chirag

+1  A: 

I'd recommend doing it at the PostgreSQL level, with something like Bucardo or Slony. If you do it at the Rails level, it will break as soon as you have a single modification made that doesn't go through rails. You may not have that today, but designing away the ability to have it in the future is very short-sighted.

Magnus Hagander