Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Load-balancing PostgreSQL queries using two different Spring datasources

$
0
0

We're attempting to set up a PostgreSQL cluster using streaming replication inside Kubernetes, but we'd prefer to avoid the trouble of going through the configuration of pgpool or any other SQL-aware load-balancers.

That being said, I'd like to ask whether it is a good idea at all to configure Spring Boot to use two datasources in the following way:

  • The first (@Primary) datasource would point towards the current PostgreSQL master and be used for read and write operations.
  • The second datasource would point towards a hot-standby replica and be used for read operations.

Provided that there are Kubernetes services that point to the current master and to the read replicas, and that failover is not automated, are there any risks in this approach?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>