This enables to use Single-Primary Database Replication, read replica
Consider the usage of https://github.com/citusdata/pg_auto_failover for managing the infrastructure.
Other references:
https://vladmihalcea.com/single-primary-database-replication/
See Connection Fail-over chapter on
https://jdbc.postgresql.org/documentation/94/connect.html