CiviCRM Clustering/load balancing

CiviCRM and Drupal can become quite heavy requiring load balancing. Here I'll discuss the database load balancing. 

 

CiviCRM can be clustered with standard MySQL Clustering right now with no code changes. Although this is a costly avenue requiring at least 3 servers for the cluster, and preferably one or two more for load balancing, as well as the one the app runs on. And performance has not been tested with CiviCRM and Cluster. Cluster can be fast but requires optimizations for how it works.

Standard MySQL Replication is possible but code changes are required to drupal and possibly CiviCRM. Standard MySQL Replication has one master and multiple slaves, the master performs writes(changes to the data) and the slaves handle all the reads, while software performs load balancing.

There is also a newer method, multiple-master replication. It has had some problems in the past but may be a viable solution for Drupal, and most likely for CiviCRM as well then. 

For more on MySQL Replication please see the official docs

For more on MySQL Clustering please see the official forums

 

Another option is web load balancing, which can also help, depending on where your bottleneck is(Database or Web) where you have a single database running and multiple web servers running. There are several issues here that must be addresses with code changes or support code, such as uploaded images(since they are web based they must exist on both sides). Sessions are also another problem, but my understanding is drupal stores sessions in the database so it becomes not an issue.

 

From here one would easily walk towards a high availability solution(imagine one or more servers crashing, are you still up and running? Is your data backed up properly?). However, the investment can be made for both using common off the shelf software, but the hardware needs to be pretty heavy.

 

While money is a big issue for non profits, there are alternatives, especially if you can tolerate some down time.