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: https://github.com/haproxy/haproxy 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. https://www.cockroachlabs.com/docs/stable/architecture/reads-and-writes-overview.html 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. https://www.cockroachlabs.com/docs/v20.1/frequently-asked-questions.html#how-does-cockroachdb-survive-failures ---------- Careers: https://www.cockroachlabs.com/careers CockroachCloud: https://www.cockroachlabs.com/product... Blog: https://www.cockroachlabs.com/blog/ Docs: https://www.cockroachlabs.com/docs/st... Community Slack: https://cockroa.ch/Welcome-to-Slack Twitter: https://twitter.com/CockroachDB