Load balancers are commonly deployed in two cases:
Deploying a load balancer also makes the web application more reliable by eliminating a single point of failure: If a service instance goes down, the load balancer will detect this failure and redirect incoming traffic to an available instance.
At a high level, there are two types of load balancers: hardware-based and software-based.
Hardware-based load balancers are proprietary equipment hosted in a data center. They carry application-specific integrated circuits that route traffic very efficiently. They require a team of sophisticated IT personnel to install, and maintain the system. On the other hand, software-based load balancers such as NGINX (https://www.nginx.com) or HAProxy (http://www.haproxy.org/) perform the load balancing in software. They can deliver the performance and reliability benefits of hardware based solutions at a much lower cost.
In addition, load balancing may be performed at various network layers:
Layer 4 load balancers balance traffic by inspecting the requests and responses at the networking transport layer. They base the load-balancing decision on the source and destination IP addresses and ports recorded in the packet header, without considering the contents of the packet. On the other hand, layer 7 load balancers operate at the highest level, the application layer. This type of load balancer is slightly more powerful, as it has a high level view of things. A layer 7 load balancer bases its routing decisions on various characteristics of the request HTTP header such as the URL.
Load balancing may be either static or dynamic. The difference between static and dynamic load balancing is the use of realtime service state information (i.e. running/stopping service instances). While static load balancers make no use of such information, dynamic load balancers use such information to improve load balancing decisions. To know the services state, dynamic load balancers must be able to dynamically add or remove a RemoteViz service instance in its routing configuration without interrupting existing connections (on-the-fly). It could be done by exposing a REST API that would be called by RemoteViz services to register/unregister. Existing load balancers supporting WebSocket protocol (NGINX, HAProxy,...) are able to load balance RemoteViz services depending on the desired load balancing scenarios.
A RemoteViz example was written to provide a simple but highly customizable and multi-platform load balancer that is able to load balance RemoteViz services efficiently. The load balancer provided in the example is a layer 7 load balancer written in Node.js (https://nodejs.org/en/) that intelligently routes the incoming connections based on the renderArea ID specified in the URL. This example can be easily customized to respond to different load balancing scenarios.
You can find more details in the example documentation: LoadBalancer