# C API High Availability Samples

> The eXtremeDB High Availability packages include sample applications that demonstrate basic HA functionality. All sub-directories except `haswitch` contain two sub-directories `master` and `replica` which contain the project files for the two parts of each sample.

> Note that HA applications can communicate on more than one channel, so the command line argument for master applications is the connection string in the form `<channel>:<port>`. For example:

>         ha_sample-master :tcp:20000

> starts the master application with the TCP communication channel using port 20000. Replica applications specify the connection string in the form `<channel>:<hostname>:<port>`. So replica applications connecting to the above master would use a command line like:

>         ha_sample-replica :tcp:127.0.0.1:20000

> If no command line arguments are specified the TCP communication channel is used on port 10000. In all of the samples, except `hamultichan`, the master doesn’t take any command line arguments. So the master always uses the TCP channel and listens on port 10000 (except `hacascade`). Since they are configured with only the TCP channel, the replicas can skip the `:tcp` part in the connection string. So for example, instead of the above, the command to launch the sample replica can be shortened to:

>         ha_sample-replica 127.0.0.1:20000

> (Note that, in addition to the C samples described below, there are corresponding Java API samples in the `java` directory.)

> Please use the links below to view the description and specific instructions for individual samples in the following sub-directories:

> haasynch | Demonstrates eXtremeDB High Availability in asynchronous mode
> habinev | Demonstrates the eXtremeDB High Availability Binary Schema Evolution feature
> hacancel | Demonstrates the use of the `mco_HA_cancel()` function to terminate replication
> hacascade | Demonstrates how to use cascade replication
> haevents | Demonstrates the use of synchronous and asynchronous events
> haextend | Demonstrates extending an eXtremeDB database in HA mode
> hafilter | Demonstrates partial replication filters on the replica and master sides
> haforce | Demonstrates the HA ‘kill’ feature
> hahotsync | Demonstrates the hot synchronization feature
> hamcast | Demonstrates the multicast mode
> hamultichan | Demonstrates the use of multiple NW channel implementations in an application
> hanotify | Demonstrates notification on the replica side
> haperf | Provides some performance statistics for create/update/delete operations in different HA modes
> hashared | Demonstrates shared commit mode
> hasimple | Demonstrates basic HA functionality
> hastateful | Demonstrates basic stateful replication
> haswitch | Demonstrates how to switch between master and replica
> hawindow | Demonstrates the HA transaction window feature