Synchronous replication vs asynchronous replication

Synchronous replication vs asynchronous replication

Data loss or not on application failover?

There is a significant difference between synchronous replication vs asynchronous replication. According the choice, you may have data loss on application failover.

Synchronous replication as implemented by the SafeKit software is essential for failover of transactional applications. With synchronous replication, all committed data on the disk of the first server are on the disk of the second server. With asynchronous replication, committed data on the disk of the first server can be lost in case of failure. There is also an alternative solution named semi-synchronous replication, with commited data on the second server but not necessary on disk.

To help you to take the right decision if you have to choose between synchronous replication vs asynchronous replication, we explain now the technical mechanisms and the impact on application failover.

Synchronous replication requires the bandwidth of a LAN between the servers, possibly with an extended LAN in two geographically remote computer rooms. Asynchronous replication can be implemented on a low speed WAN.

Synchronous replication

With synchronous file-based replication as implemented by the SafeKit high availability software, when a disk IO is performed by the application or by the file cache system on the primary server inside a replicated file, SafeKit waits for the IO acknowledgement from the local disk and from the secondary server, before sending the IO acknowledgement to the application or to the file system cache. This mechanism is essential for failover of transactional applications. Note that SafeKit makes byte-level file replication by replicating directories and not entire disks, which greatly simplifies the configuration of a cluster.

Note that many high availability solutions with synchronous replication of Microsoft SQL Server, PosgreSQL, flat files etc... are available with a Safekit free trial in the following article. Note also that SafeKit is able to automatically re-synchronize a failed server without any manual operation and without stopping the critical application. It is an important differentiator when comparing SafeKit to replication solutions whose failover only works once: reintegrating the failed server in the cluster requires complex and non-automated manual operations.

Asynchronous replication

With asynchronous file-based replication implemented by most solutions, the IOs are placed in a queue on the primary server but the primary server does not wait for the IO acknowledgments of the secondary server. So, all data that did not have time to be copied across the network on the second server is lost if the first server fails. In particular, a transactional application loses committed data in case of failure.

Semi-synchronous replication

With the semi-synchronous file-based replication as implemented by the SafeKit high availability software, the asynchrony is not made on the primary server but on the secondary one. In this solution, SafeKit always waits for the acknowledgement of the two servers before sending the acknowledgement to the application or the system cache. But on the secondary, there are 2 options asynchronous or synchronous.

In the semi-synchronous case, the secondary sends the acknowledgement to the primary upon receipt of the IO and writes to disk after. In the synchronous case, the secondary writes the IO to disk and then sends the acknowledgement to the primary.

But be careful, the synchronous mode on the secondary server is required if we consider a simultaneous double power outage of two servers, with inability to restart the former primary server and requirement to re-start on the secondary.

Conclusion

You see that just delaying write on the secondary server has a direct impact on critical application failover. So be very careful when choosing synchronous replication vs asynchronous replication. Always prefer a synchronous or a semi-synchronous replication for a critical application.

Key differentiators of file replication and failover with the Evidian SafeKit mirror cluster

Evidian SafeKit mirror cluster with real-time file replication and failover

Synchronous relication Synchronous replication

Like  The real-time replication is synchronous with no data loss on failure

Dislike  This is not the case with asynchronous replication

After a server failure, fully automated failback procedure Automatic failback

Like  After a server failure and a failover, the replication failback procedure is fully automatic on the failed server and without stopping the application on the only remaining server

Dislike  This is not the case with most replication solutions particularly with replication at the database level. Manual operations are required for resynchronizing a failed server. The application may even be stopped on the only remaining server during the resynchonization of the failed server

All clustering features All clustering features

Like  The solution includes all clustering features: server failure monitoring, network failure monitoring, software failure monitoring, automatic application restart with a quick recovery time, a virtual IP address switched in case of failure to automatically reroute clients. A clustering configuration is simply made by means of a high availability application module. There is no domain controller or active directory to configure on Windows. The solution works on Windows and Linux

Dislike  This is not the case with replication-only solutions like replication at the database level

Dislike  Quick application restart is not ensured with full virtual machines replication. In case of hypervisor failure, a full VM must be rebooted on a new hypervisor with an unknown recovery time

Replication of any type of data

Like  The replication is working for databases but also for any files which shall be replicated

Dislike  This not the case for replication at the database level

File replication vs disk replication File replication vs disk replication

Like  The replication is based on file directories that can be located anywhere (even in the system disk)

Disike  This is not the case with disk replication where special application configuration must be made to put the application data in a special disk

File replication vs shared disk File replication vs shared disk

Like  The servers can be put in two remote sites (connected to the same extended LAN for virtual IP failover)

Dislike  This is not the case with shared disk solutions

Quorum with remote sites Quorum with remote sites

Like  The solution works with only 2 servers

Like  This is not the case for most clustering solutions where a 3rd server is required for the quorum

Uniform high availability solution Uniform high availability solution

Like  SafeKit implements a mirror cluster with replication and failover. But it imlements also a farm cluster with load balancing and failover. Thus a N-tiers architecture can me made highly available and load balanced with the same solution on Windows and Linux (same installation, configuration, administration with the SafeKit console or with the command line interface). This is unique on the market

Dislike  This is not the case with an architecture mixing different technologies for load balancing, replication and failover

FAQ on Evidian SafeKit (synchronous replication)

3 demonstrations [+]

Application high availability modules [+]

Cloud solutions [+]

Customers [+]

Best use cases [+]

Distinctive advantages [+]

More on the mirror cluster [+]

More on the farm cluster [+]

SafeKit Webinar [+]

Pricing - Free trial [+]

contact
CONTACT
Demonstration

Evidian SafeKit Pricing





White Papers

NEWS

To receive Evidian news, please fill the following form.