Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a local application running on a LAN. Sometimes a database gets shutdown. In such a scenario how can I keep the application working? Can I have two concurrent databases so that one picks up the work when the other becomes unavailable?


migration rejected from Jun 12 '13 at 11:54

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as not a real question by Mark Storey-Smith, Mat, Paul White, RolandoMySQLDBA, dezso Jun 12 '13 at 11:54

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

First, "sometimes one of them gets shut down" isn't a good approach. You need controlled infrastructure or you won't get anything reliable.

You might want to look in to PgPool-II's statement-based replication, but it's got a lot of limitations.

A better solution for most applications is to use master/standby fail-over with heartbeat and HAProxy or similar. See the manual for more info. This wiki page might also be interesting, though it's more of a link catalogue.

repmgr can be a useful part of a HA setup, and the new version is being enhanced with some more HA-specific features.

Finally, the team I'm a minor part of is working on bi-directional logical replication for PostgreSQL, which would provide multi-master replication (not multi-master "clustering" since there's no global transaction manager, global lock manager, etc).

Netflix would disagree with you:… – Neil McGuigan Jun 11 '13 at 17:33
@NeilMcGuigan Oh, I completely agree, and that's a good point. We're just talking about very different scales and experience levels here - I don't think this Mridul person is quite ready for chaosmonkey if they're asking questions like this one. – Craig Ringer Jun 11 '13 at 23:24