Re: PostgreSQL Replication - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: PostgreSQL Replication
Date
Msg-id 20210219173545.GF10464@hjp.at
Whole thread Raw
In response to Re: PostgreSQL Replication  (Mutuku Ndeti <jnmutuku@gmail.com>)
List pgsql-general
On 2021-02-17 12:22:50 +0300, Mutuku Ndeti wrote:
> I agree with you. Single master, with a standby replica, seems easier to
> manage. Is there a way to automatically promote the standby, when the active
> master fails?

Yes. There are several solutions. We use Patroni, which is simple to set
up and seems to "just work" (we routinely cause a failover every few
weeks and so far it has always worked fine). Patroni is quite
postgres-specific, though, so if you want to manage other applications,
too, you may want to look into more generic solutions.

> Is it feasible to have 2 instances of the application, writing onto
> the same DB, reason for two instances of the application is to allow
> for redundancy/load balancing. 

You can have any number of applications writing into the same database.
At some point you might exceed the capacity of your hardware, but that's
a function of load in general, not the number of applications.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Re: checkpointer and other server processes crashing
Next
From: Tom Lane
Date:
Subject: Re: Allowing John to Drop Triggers On Chad's Tables