# eXtremeDB Transaction Logging with HA and Cluster

> In some cases it is desirable to enhance eXtremeDB High Availability (HA) and/or eXtremeDB Cluster applications. For example, you might want one node of a cluster, or an HA replica, to be responsible for replicating data asynchronously to an external system in the “cloud” using Data Relay.

> The general algorithm to enable database persistence via Transaction Logging in C, C++, Java, C# and Python applications is to perform the following:

> - try to load a database snapshot if one has been saved, or else open an empty database
> - apply the log file if it exists
> - save a new database snapshot
> - start transaction logging
> - attach the node to a cluster or initiate HA
> - perform the usual node activity until the successful conclusion or a crash occurs
> - stop transaction logging, detach the node from the cluster and close the application

> Also `xSQL` is capable of implementing transaction logging within a cluster node or with HA. Simply add a TL configuration section like the following to specify the database snapshot and log files:

>         tl_params : {
>             log_path : "db_file.log",
>             snapshot_path : "db_file.img",
>         },

> This set of `xSQL` options enables the snapshot and log file persistence in the same manner as with the embedded API algorithm described above.