balancing PostgreSQL queries using two different Spring datasources
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:
@Primary
) datasource would point towards the current PostgreSQL master and be used for read and write 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?
链接地址: http://www.djcxy.com/p/77390.html