Re: [JDBC] Multiple databases? - Mailing list pgsql-jdbc

From Turbo Fredriksson
Subject Re: [JDBC] Multiple databases?
Date
Msg-id F82247A7-1AE8-4812-96D5-0AC3E83E2437@bayour.com
Whole thread Raw
In response to Re: [JDBC] Multiple databases?  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
On 15 Sep 2017, at 02:34, Dave Cramer <pg@fastcrypt.com> wrote:

> I thought RDS kept the endpoint the same when one of the replica's dies?

I’m not sure and I don’t know how to test this. I can’t just stop the master.
AWS refuses to if/when there’s replicas to it. I can “delete” it, but that won’t
do anything to any of the replicas that I have seen. No promotion and no
changing of endpoint address.

And from what I remember, the only thing the documentation say about
a crashed master is that “AWS will automatically promote one of the replicas
to new master”. It doesn’t say if the endpoint changes with it.

But considering that the DB instance name is part of the endpoint address,
I doubt it WILL change!

> The driver doesn't do load balancing.

Ok, thanx. So how does that work if I add multiple DB endpoints? It will
only use the first one, in a read/write capacity? What if that one stops
responding, will the driver then try the next endpoint?

Will the driver be “smart” enough to recognise that this is a read/only
DB and not do writes? Or will it try again with the next in line (third one)?

> Yes, it does know when it connects but if that situation changes it will not be able to figure it out

Ok, so as long as one uses non-persistent DB connection and open up
a connection every time it’s needed, this should “hopefully” work?


pgsql-jdbc by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: [JDBC] Multiple databases?
Next
From: Turbo Fredriksson
Date:
Subject: Re: [JDBC] Multiple databases?