Table of Contents

Failover & Load Balancing Clusters

This article discusses options for scaling-out, and for increasing availability of Digital-Clay systems using redundant failover machines. For scaling up, or for first-stop tips on increasing performance see Increasing Digital-Clay Performance.

Although this article focuses on Windows Clusters, note that most of the issues and concepts also apply to other solutions such as hardware-based network load-balancers.

Failover Clusters

Failover Clusters are used when high availability is needed, and when automatic and rapid recovery from either hardware or software failures is critical. Although an understanding of Windows Clusters is assumed, here are some important notes and highlights:

Making Digital-Clay Work with Failover Clusters

Although a fully 'cluster-aware' application may make use of Windows Clustering API, expose special Clustering Properties via a Custom Cluster Resource Type, and listen to all Cluster events, to make an application work as a highly available Cluster Resource takes minimal work:



Load Balancing

The goal of Load Balancing is to increase performance in a system with many concurrent users and queries by spreading the requests and connections over several machines.

Note that before scaling-out this way, it is much more preferable and simple to scale-up or tweak more performance out of the system using the methods listed in Increasing Digital-Clay Performance. For example, before even considering a load balancing solution, SQL Server and ClayCentral should be split onto two machines, each with maximum CPUs or CPU cores, and maximum memory/FSB speeds, thus spreading the load over two machines and allowing Clay to handle more concurrent requests faster.

With database solutions, load balancing would only help with components that require no persistent data, or with read operations. A fully load-balanced database solution means that any write would have to be replicated, thus making all write operations that much slower. Thus a write-intensive system may not benefit from load balancing and may even be slower. But since most solutions read more than they write, load balancing should provide performance gains if they are set up correctly.

This section will cover load balancing of three critical and resource-hungry components in a Digital-Clay system:

ClayCGI Web Module

This is a common and relatively easy target for load balancing. Web-farms are often used to handle many concurrent WWW requests, and ClayCGI may be run within these environments just like any other CGI program. For example, IIS servers may be clustered and load balanced in the standard way, each running an identical copy of the ClayCGI module and support files, all of which retrieve data as necessary from a single ClayCentral/SQL Server.

This is the easiest component to load-balance because there is no persistent data.

The only requirement is that the load balancer needs to support Affinity rules. I.e. since ClayCGI is a FastCGI component and maintains session, caching and connection information between requests for speed, requests originating from the same IP need to be routed to the same machine every time. This is easily done in Windows Load Balancing Clusters by checking the Affinity rule option when adding Port Rules.

Database

The bottom line is that currently, SQL Server does not support load balancing in a comprehensive way that is adequate for many Digital-Clay systems due to some SQL Server limitations and the nature of Digital-Clay solutions. But there are some practical usage scenarios described below. Here are some good articles:

And here are the relevant summarized points, some of which apply to other databases as well:


Replication: There are two primary forms of replication in databases: Synchronous and asynchronous.


Partitioning: A database may be split in several ways in order to achieve a kind of load balancing by spreading out the data:


In summary, these are the current limited possibilities for load balancing databases:

ClayCentral

See above regarding SQL Server limitations on load balancing with Digital-Clay solutions. Since most of the load of Digital-Clay systems is handled by the database, the database will most often become a bottleneck before ClayCentral does. Which means that the limitations described above need to be addressed, and that priority needs to be placed on one of the aforementioned solutions before even considering ClayCentral load balancing.

To load-balance ClayCentral itself would require advanced cluster mechanisms to handle the updating of caches both at ClayCentral and clients, as well as for safe conflict management. All of this is currently being researched for future releases.