If a Node Becomes Unavailable, Does YugabyteDB Propagate Client Requests to Surviving Nodes? Or Do Clients Have to Handle That Retry Logic?

Distributed SQL Tips and Tricks
Marko Rajcevic

The answer depends on a few characteristics:

  • Are the clients connected directly to the node, or through a load balancer?
  • Are you using the PostgreSQL driver, or the YugabyteDB Smart Driver?
  • Are you using connection pooling?

If you are connected directly to the node, then the physical connections to that node will be invalidated. Your connection pool will automatically adjust the minimum pool requirements for the other nodes in the cluster.

If required, it creates new connections to the surviving nodes, which will be transparently managed. If the node goes down abruptly in the middle of inflight transactions, those transactions will fail, and clients can retry. Or, you can set the retry logic on the application layer, based on the error code. Again, in this case, your connection pool should invalidate already established physical connections to the failed node.

From a connection string perspective, it is better to pass more than a single endpoint (at least 2/3 endpoints) so that net new client connections get established based on the remaining available endpoints. If you keep only one endpoint, there will not be any impact on the existing connections, but you can’t create net new client connections if that single endpoint is down.

An example of this recommendation using the YugabyteDB Smart Driver is:

jdbc:yugabytedb://127.0.0.1:5433,127.0.0.2:5433,127.0.03:5433/yugabyte?load-balance=true

NOTE: If using multi-region clusters, you want to have at least one per endpoint per region.

Discover More Tips and Tricks

A library of distributed SQL tips and tricks and general “how to” information can be found by searching the YugabyteDB blog, as well as our DEV Community Blogs.

Events and Training

Check out the upcoming YugabyteDB events, including all training sessions, conferences, in-person and virtual events, and YugabyteDB Friday Tech Talks (designed for engineers by engineers).

In addition, there is some extremely popular “how to” content on the YugabyteDB YouTube channel.

If You Have Questions About Distributed SQL

This blog series would not be possible without the support of fellow Yugabeings such as Denis Magda, Dorian Hoxha, Franck Pachot, and Frits Hoogland, to name a few. We also thank our incredible user community for not being afraid to ask questions.

If you have questions, make sure to ask them on the YugabyteDB Slack channel, Forum, GitHub, or Stack Overflow. For more tips and tricks, check out our Distributed Tips and Tricks archive.

Next Steps

Ready to start exploring YugabyteDB features? You have some great options to get started. Run the database locally on your laptop (Quick Start), deploy it to your favorite cloud provider (Multi-node Cluster Deployment), sign up for a free YugabyteDB Managed cluster, or request a full-featured trial. It’s easy! Get started today!

Marko Rajcevic

Related Posts

Explore Distributed SQL and YugabyteDB in Depth

Discover the future of data management.
Learn at Yugabyte University
Get Started
Browse Yugabyte Docs
Explore docs
PostgreSQL For Cloud Native World
Read for Free