solidDB Help : High availability : solidDB HotStandby : Replication protocols in HotStandby : 2-safe replication
  
2-safe replication
If you use 2-safe replication with HotStandby (HSB), the primary server does not tell the client that the transaction has been successfully committed until the primary server receives an acknowledgment that the secondary server has received the transaction.
 
Description
Illustration
Application commits transaction.
Primary server sends committed transaction to secondary server.
The diagram is described in the first column of the table
Secondary server acknowledges committed transaction and asynchronously writes transaction to log.
Primary server acknowledges committed transaction.
The diagram is described in the first column of the table
There are three different acknowledgment policies with 2-safe replication:
2-safe received
The secondary server sends an acknowledgment when it receives the data as shown in the following table:
 
Description
Illustration
Application commits transaction.
Primary server sends committed transaction to secondary server.
The diagram is described in the first column of the table
Secondary server acknowledges committed transaction and asynchronously writes transaction to log.
Primary server acknowledges committed transaction.
The diagram is described in the first column of the table
This is the fastest acknowledgment policy and reduces latency (the amount of time between the start of the commit and the time that the user receives confirmation of the commit). The 2-safe received policy has little impact on overall throughput.
2-safe visible
The secondary server sends an acknowledgment when its copy of the data is updated, and the change is visible, as shown in the following table. In other words, a client application that is connected to the secondary server can see the update.
 
Description
Illustration
Application commits transaction.
Primary server sends committed transaction to secondary server.
Secondary server updates data in memory.
The diagram is described in the first column of the table
Secondary server acknowledges committed transaction and asynchronously writes transaction to log.
Primary server acknowledges committed transaction.
The diagram is described in the first column of the table
2-safe durable
The secondary server sends an acknowledgment when it has made the data durable, that is, when it has committed the data and written the data to the disk, as shown in the following table:
 
Description
Illustration
Application commits transaction.
Primary server sends committed transaction to secondary server.
The diagram is described in the first column of the table
The following actions occur synchronously:
Secondary server writes transaction to log (1).
Secondary server acknowledges committed transaction (2).
Primary server acknowledges committed transaction (3).
The diagram is described in the first column of the table
This is the safest acknowledgment policy.
Because the acknowledgment policies apply only when both the primary and secondary server are active, even the 2-safe received acknowledgment policy can be considered safe. You risk losing transactions only if both servers fail almost simultaneously (within a second of each other).
See
Synchronous HotStandby with 2-safe replication
Go up to
Replication protocols in HotStandby