Chapter 11. Clustering WildFly Applications

In the previous chapters, we went through the most interesting aspects of developing Java Enterprise applications. Once you are ready to roll out your applications, it is important that you guarantee your customers a responsive and fault-tolerant environment. This requirement can be achieved through application server clustering.

WildFly clustering is not the product of a single library or specification, but rather a blend of technologies. In this chapter, we will first introduce some of the basics of clustered programming. Then, we will quickly move on to the cluster configuration and its setup, which will be required to deploy some clustered applications.

The following list is a preview of the topics that will be covered in this chapter:

  • What clustering is and how WildFly implements it
  • Setting up clusters in the standalone and domain mode
  • Developing clustered Java EE 7 applications in order to achieve load balancing and high availability

Clustering basics

A cluster of application servers consists of multiple server instances (cluster nodes) running simultaneously and working together to provide increased scalability and reliability. The nodes that make up a cluster can be located either on the same machine or different machines. From the client's point of view, this is irrelevant because the cluster appears as a single server instance.

Introducing clustering in your applications will produce the following benefits:

  • Horizontal scalability (scaling out): Adding a new node to a cluster should allow the overall system to service a higher client load than that provided by a simple basic configuration. Ideally, it should be possible to service any given load simply by adding the appropriate number of servers or machines.
  • Load balancing: In a clustered environment, the individual nodes that compose the cluster should each process a fair share of the overall client load. This can be achieved by distributing client requests across multiple servers, which is also known as load balancing.
  • High availability: Applications running in a cluster can continue to do so when a server instance fails. This is achieved because applications are deployed on multiple nodes of the cluster, and so if a server instance fails, another server instance on which that component is deployed can continue with application processing.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.161.225