These rules are simple, but that's one of the reasons they're often overlooked. Always communicate with the Primary node through at least one proxy.
Even if this is merely an abstract network name, or an ephemeral IP address, doing so prevents problems that could occur, as seen in the following diagram:
What happens when the Primary PostgreSQL node is offline and the cluster is now being managed by the Standby? We have to reconfigure—and possibly restart—any and all applications that connect directly to it. With one simple change, we can avoid that concern, as seen here:
By following the second guideline, all traffic is ...