Skip to main content

How to use a load balancer

In this video tutorial Matt Vardi, a technical support engineer at Cockroach Labs, walks you through how to use a load balancer and explains how load balancing can improve the performance and resiliency of your applications. Note: in the demo Matt uses HAProxy - is a popular open source load balancer that takes incoming requests and distributes them across a range of nodes/VMs. Here's the link to their git: 00:00 introduction to host, Matt Vardi 00:36 How to get set up with the load balancer in CockroachDB 00:59 How to start the load balancer 1:17 What database performance looks like without a load balancer 2:08 Database performance with a load balancer *How does Load Balancing improve performance?* By using a load balancer, we can fully utilize the resources of every node in our cluster instead of relying on one node’s resources to process every incoming request to the database. How does Load Balancing improve resiliency? By using a load balancer, our application is able to send requests to every CockroachDB node. If one node were to go down, the load balancer would still send requests to the remaining active nodes in order to keep your application running. In a scenario where your application sends all of it’s requests to one node, if that node were to go down then it would appear that your application can’t connect to the database although the database is still up and accessible through the other nodes in your cluster. ---------- Careers: CockroachCloud: Blog: Docs: Community Slack: Twitter: