What is the difference between Clustering and Load balancing?
I know it is a simple question.But I asked this question to several people, But no one gave reliable answer.
Also I googled a lot and can't get an exact answer .
Hope our Stack users will give the best answer for me.
From Software journal blog an extract.
Clustering has a formal meaning. A cluster is a group of resources
that are trying to achieve a common objective, and are aware of one
another. Clustering usually involves setting up the resources (servers
usually) to exchange details on a particular channel (port) and keep
exchanging their states, so a resource’s state is replicated at other
places as well. It usually also includes load balancing, wherein, the
request is routed to one of the resources in the cluster as per the
load balancing policy.
Load balancing can also happen without
clustering when we have multiple independent servers that have same
setup, but other than that, are unaware of each other. Then, we can
use a load balancer to forward requests to either one server or other,
but one server does not use the other server’s resources. Also, one
resource does not share its state with other resources. Each load
balancer basically does following tasks: Continuously check which
servers are up. When a new request is received, send it to one of the
servers as per the load balancing policy. When a request is received
for a user who already has a session, send the user to the same
server (This part is important, as otherwise user would keep going
between different servers, but not able to really do any work). This
part is not required for serving static pages, in that case, there are
no user sessions.
Clustering means you run a program on several machines (nodes). One reason why you want to do this is: Load balancing. If you have too much load/ work to do for a single machine you can use a cluster of machines instead. A load balancer then can distribute the load over the nodes in the cluster.
A cluster is a group of application servers that transparently run your J2EE application as if it were a single entity.
Source
On the infrastructure side, the processing load must be distributed among the group of servers. This is known as server load balancing.
Source
So basically clustering is to create a cluster, and load balancing is to distribute the load among the nodes in the cluster
Clustering:
Clustering is becoming increasingly important in the world of
enterprise application development.just
sharing the application state across multiple Java Virtual
Machines (JVM's)
Load balancing
its simple like balaning the request and forwarded to appropriate server for handling the request