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

From Turbo Fredriksson
Subject [JDBC] Multiple databases?
Date
Msg-id BC136827-8804-455B-BB30-14E728F22D74@bayour.com
Whole thread Raw
Responses Re: [JDBC] Multiple databases?
List pgsql-jdbc
I’m the system administrator of our environment in AWS. We’re running
a Scala app on there, which accesses a RDS (PostgreSQL) cluster in
AWS.

This cluster consists of one master (read/write) and several slaves/replicas
(read/only).

All these have a different endpoint to access them. If the master dies,
AWS will promote one of the replicas as master automatically (if I understand
the documentation correctly), but I’m not sure if it will also update the
endpoint. I’m fairly certain it doesn’t.

Meaning, the app can no longer access the DB!

There’s two solutions to this:

1) Add all endpoints, after each other, in the config.
2) Add a DNS round-robin entry with all endpoints.

For point one, will the driver only try subsequent endpoints/DBs IF the
first fails? As in, no load balancing :(.

For point two, my question is (and my developer don’t know and don’t have
time to dig into this - he have googled, but have not found a determinate
answer) is if the pgsql-jdbc driver can recognise which of these are the master
automatically. As in, does it “know” which one it can write to?



pgsql-jdbc by date:

Previous
From: rob stone
Date:
Subject: Re: IllegalState Exception
Next
From: Dave Cramer
Date:
Subject: Re: [JDBC] Multiple databases?