Introduction
This page describes how the architecture of M-Switch is very well suited
for use in High Availability (HA) Deployments. Typically HA deployments
result in inefficient use of expensive Hardware Resources, M-Switch
has been developed such that it can provide HA with efficient use of
Hardware.
Typical HA Deployment
HA deployments use operating system utilities such as clustering to
provide HA. In these cases a backup server is running in standby mode
waiting for the primary server to fail. Failure is detected by "Heartbeat
Monitoring" between the two servers and when the primary server
fails the backup server seamlessly takes over. In this scenario there
is often an expensive backup server essentially providing no services
but just waiting for the primary server to fail.
Table Based M-Switch HA Deployment
M-Switch supports both table based configuration and directory based
configuration. In the Basic HA deployment we will use table based configuration.
Like the typical HA deployment M-Switch uses two servers with 'Heartbeat
Monitoring'. The difference is that there is also hardware load balancing
of the servers such that equal amounts of traffic are processed by each
server during normal operation. The diagram below shows this configuration.

In the event of a server failing the remaining server starts a secondary
M-Switch process to pick up the message queue on the failed server thus
ensuring no messages are lost.
The benefit of this deployment is that you are making full use of your
hardware resources while they are available and that when a failure
occurs there is no service interruption and no loss of messages.
Directory based M-Switch HA Deployment
In situations where Directory Based configuration is required a similar
configuration to the Basic one is used but with the addition of the
M-Vault Master and M-Vault Shadow to Server #1 and Server # 2 respectively
as shown in the diagram below.

The M-Vault shadowing means that the data is continually replicated
from master to the shadow and during normal operation read requests
are load balanced across the two servers. In the event of Server #1
failing then all directory read requests will be passed to Server #2.
As the M-Vault Master is unavailable, add/modify/delete operations will
result in a failure and have to be retried once the Server #1 is operational.
A more complex configuration can avoid this, by having the M-Vault master
fail over onto Server #2. If Server #2 fails all directory Operations
will continue as normal but be passed to M-Vault master Server #1.
Complex M-Switch HA Deployment
In large deployments such as ISPs two load balanced servers may not
be sufficient to handle the volume of email and in this case pairs of
servers would be deployed and potentially spread across multiple sites
for Disaster Recovery (DR) situations. In this configuration there would
only be two master M-Vault servers, one on the primary site and one
on the DR site. The diagram on the following page shows how this can
be configured.