4 Essential Types of Replication Modes in SAP HANA System Replication
Today, we are going to discuss the replication modes used in SAP HANA system replication. We will be discussing three main types of replication modes, i.e., Synchronous in-memory, Synchronous, Synchronous full sync and Asynchronous replication mode.
Have you checked? – SQL data types in SAP HANA
Don't become Obsolete & get a Pink Slip
Follow DataFlair on Google News & Stay ahead of the game
Replication Modes in SAP HANA
Before we start discussing the three types of replication modes in SAP HANA system replication, we must understand, what is system replication in SAP HANA.
System replication is the process of replicating or copying an SAP HANA database to a secondary location within the same or to an external data center. The SAP database can continuously and simultaneously synchronize with the primary system besides replication. So, when you register a secondary system to replicate your HANA database, you have to select a replication mode to conduct in the system replication. System replication is primarily to support disaster recovery and high availability in SAP HANA.
There are primarily four types of replication modes for system replication:
- Synchronous in-memory (syncmem)
- Synchronous (sync)
- Synchronous (full sync)
- Asynchronous (async)
Let us learn about all four replication modes in detail, in the sections to follow.
1. Synchronous In-memory Mode
The synchronous in-memory mode is the default replication mode. The primary node waits for a confirmation message by the secondary node upon receiving the log successfully. Until then, the primary node/system commits no transactions.
In other words, the secondary system sends an acknowledgment back to the primary system upon receiving data successfully in its in-memory. The syncmem is an ideal replication mode for solutions focusing on high availability and disaster recovery. Both the nodes reside on the same data center or in close proximity.
For successful data replication, all the services at both nodes (primary and secondary) must have ACTIVE status. If any one of the services fails, then this might result in data loss and replication failure. No data loss occurs if all the services stay in active mode during the log transfer.
One significant advantage of using this mode is that it offers shortest transaction delays. It is because the primary node halts its transactions until the secondary node sends an acknowledgment. The standard wait time is 30 seconds. If the primary node does not receive any acknowledgment from the secondary system, it resumes the transactions without replicating data. This ensures the shortest possible transaction delays. Also, this process is performance-optimized as the speed of disk I/O operations on the secondary system does not affect the primary system’s performance. Thus, the primary system doesn’t have to wait for any disk writing or I/O activity moving to the secondary system.
2. Synchronous Mode
In the synchronous mode of system replication, the primary node waits and halts its transactions till the time the secondary node sends an acknowledgment. The acknowledgment indicates the acceptance of the data log and persistence of the log volumes on its disk. The main advantage of using sync mode is that it ensures and maintains consistency between the two nodes. The primary node ensures that it will not commit any transaction before the replication on the secondary node completes.
The waiting time of primary node for receiving an acknowledgment from secondary node is 30 seconds. It resumes its transactions without completing the replication process if no “receive” message arrives from the secondary system in 30 secs. Also, this process is only prone to data loss when the two nodes disconnect during an ongoing replication. However, no data loss occurs when the connection is still intact but the primary node has resumed executing its transactions. This replication mode is preferable in a high availability system replication setup, where both the nodes reside on the same data center.
3. Synchronous Full Sync Mode
In addition to the normal sync mode, another mode was introduced with SPS08 named full sync. The full sync mode ensures complete data protection, i.e., zero data loss because it blocks the transactions on the primary node until replication successfully completes on the secondary node. The operations on the primary node are blocked until the secondary node sends an acknowledgment indicating that it has received the data logs and persisted the log volumes on the disk. The full sync mode of replication is ideal for multi-tier system replication setups as their primary concern is data security and protection. Full sync mode guarantees zero data loss and thus should be used by systems using tier 2 and tier 3 nodes.
To activate the full sync mode in your HANA system, the parameter ‘enable_full_sync’ (in the global.ini file of system replication section) should be Enabled. Also, to completely activate the full sync mode, the connection to the secondary node should be established.
4. Asynchronous Mode
The asynchronous mode, as the name suggests, is where the primary and secondary nodes work asynchronously. In this mode, the primary node does not halt its transactions until the secondary node sends acknowledgment or confirmation. Instead, the primary node commits a transaction that has been written on the log file of the primary system and sent to the secondary node. It then sends redo log buffers to the secondary system asynchronously.
The asynchronous mode is the best system replication mode in terms of performance as there are no transaction delays and it maintains data consistency throughout the process. Also, it is not necessary for replication mode to wait for the I/O operations on the secondary node. However, this mode is more vulnerable to data loss as compared to other modes because unexpected failovers and unplanned takeovers may cause data loss.
Evaluate your SAP HANA knowledge – SAP HANA Quiz
This comes to the end of our discussion on system replication modes in SAP HANA. We hope you were able to understand the different replication modes easily and liked our explanation.
Did you like the SAP HANA replication modes article? Any feedbacks or queries, drop them in the comment section below.