YugabyteDB is a PostgreSQL-compatible Open-Source Distributed SQL database. It adds horizontal scalability to applications built for PostgreSQL. We can use pREST works by connecting to any YugabyteDB node.
Start prestd with the PostgreSQL connection string to one YugabyteDB node ( default port is 5433 )
Node locality
In a public or private cloud, there are multiple ways to scale out the pREST servers with YugabyteDB nodes:
Start prestd with PREST_PG_URL set to a cluster service (HA proxy, Kubernetes ClusterIP...) over the YugabyteDB nodes
Start one prestd for each YugabyteDB node, with its local IP
change the github.com/jackc/pgx driver to the cluster-aware one github.com/yugabyte/pgx/v4, as in https://docs.yugabyte.com/preview/drivers-orms/go/yb-pgx/, so that it discovers all nodes of the cluster from any node.
With geo-distribution, it is recommended to co-locate the prestd server in the same zone as the database node(s) it connects to. This will lower the latency and increase availability.