In a cluster, the nodes can often handle load balancing themselves. Busy nodes can communicate with others, and transfer work to nodes that are not so busy. A non-clustered topology of nodes that do not communicate with each other can also be load balanced, as seen in the following diagram:
The nodes will then have a common gateway, or load balancer, in front of them, which routes traffic to the available nodes. The routing is usually performed according to an algorithm (such as first-available, sticky-session, or round-robin) that may or may not adapt itself based on the traffic to, and load on, each node. Using Apache HTTPD with a mod_cluster module as a load balancing gateway in front of a farm of WildFly application servers is a very common setup. We mentioned this setup in Chapter 7, Tuning the Web Container in WildFly, and will look into it further in a little while.