Dear YugaByte team,
I’m building an application with a 3-node yugabyte cluster.
My cluster is deployed on AWS. I’m using nodejs in a serverless fashion.
The client library I’m using for YSQL is prisma2 but my problem is the same for any other postgres client library, I think.
Since there seems to be no way of telling the client library that there are three contact points for the database, I’m randomly choosing an IP-address from the three available when initializing the client.
Now, when one node goes down and stays down or is unreachable for whatever reason (which just happened to me) I face timeouts of my API because the client occasionally tries to connect to the node which is unreachable and does not fail fast and tries another one. The client is not aware of the cluster.
Now my question is: What is the recommended approach to handle this situation?
Do I need a Load-balancer and if so how do I set one up?
Is there a simpler way?
Thanks!