Load balancing is used to distribute network load among multiple components or software systems. Load Balancers support for different load balancing algorithms like roundrobin, random, by weight etc maximizes utilization of cluster nodes and reduces the chances of service unavailability due to over loading of some member nodes.
Benefits of using Load Balancer with EMQ X Cluster
Following is the list of core benefits we get by introducing a load balancer into a EMQ X Cluster.
High Availability of EMQ X Broker nodes by avoiding failure of any member node of EMQ X Cluster.
Improved responsiveness of EMQ X Cluster services by reducing the response time.
Optimized Resource Usage
Optimized usage of available resources by forwarding the network traffic to most optimal / available broker nodes of EMQ X Cluster.
Most of the Load Balancers support SSL/TLS, this can be used to terminate SSL/TLS connection at load balancer end and plain connections can be forwarded to EMQ X Broker nodes. Load on EMQX Broker nodes can be reduced by offloading the SSL/TLS connections.
Simplification of client-side Configurations
Without load balancer you will have to put address of all EMQ X Broker Nodes for EMQ X MQTT Client. With load balancer you just need to specify load balancer urlwhich makes configuration of MQTT Client simple.
With load balancer in front EMQ X Broker nodes are not exposed directly to external world so outside world does not know about the internal network resulting in improved security.
You can configure load balancer for EMQ X Cluster on public cloud providers and private cloud networks using load balancer service offered by public cloud providers or software solutions like HAProxy or NGINX.
To keep this article simple and concise, I have divided it into multiple sections. I will explain configuration and setup of all major load balancer solutions for public cloud providers and private cloud / networks in following articles.
*Upcoming articles in this series.
- EMQ X deployment with HAProxy Load Balancer on private network.
- EMQ X deployment with ELB Load Balancer on Amazon AWS Cloud.
- EMQ X deployment with NGINX Plus Load Balancer on private network.
That’s it, hope you enjoyed it. You like this article, have any questions or suggestions please let us know in the comments section.
Thanks and Happy Learning!