Skip to content

Connection String for Connecting to Cluster #1962

Answered by elliotcourant
alidehghan asked this question in Q&A
Discussion options

You must be logged in to vote

If any node in your cluster can accept read and write queries (which I do not know off the top of my head if Yugabyte does, I know Cockroach does) then you should give your cluster a DNS name and have all the IPs in the cluster as records on that DNS name.
Then using the DNS name in your connection string will connect you in a "round-robin"-esque fashion to your clsuter.

Another option would be to put something like a load balancer in front of the cluster. This would also be beneficial as the load balancer could perform health checks so as nodes restart (if they ever do) your application would not need to do anything to handle it, as the load balancer would handle it gracefully.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@elliotcourant
Comment options

@alidehghan
Comment options

Answer selected by alidehghan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants