Take the 2-minute tour ×
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. It's 100% free, no registration required.

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 stackoverflow.com 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.

1 Answer 1

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: thenextweb.com/insider/2013/03/03/… –  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