Help Center> Data Replication Service> FAQ> Real-Time Disaster Recovery> Common Exceptions in Real-Time Disaster Recovery

Common Exceptions in Real-Time Disaster Recovery

Due to certain uncontrollable reasons, data may be inconsistent when data in both the databases is changed at the same time in the multi-active DR scenario. This section describes common data exceptions. The dr1 and dr2 databases are used as examples in the following scenarios.

Scenario 1: In dual-active DR mode, operations are performed on the same row in the two databases at the same time. As a result, multiple data records are generated.

  • The following figure shows the initial data (seqno is the primary key and column1 is the non-primary key).
    Figure 1 Initial data in the dr1 and dr2 databases
  • Perform the following operations on both databases:
    • dr1: update dr1 set seqno=5 where column1=8;
    • dr2: update dr2 set seqno=6 where column1=8;
  • After the operations are performed, the data in the databases is consistent but an additional row is generated.
    Figure 2 Data in the dr1 and dr2 databases

Scenario 2: In dual-active DR mode, operations are performed on the same row in both databases at the same time. As a result, data records become inconsistent.

  • The following figure shows the initial data (seqno is the primary key and column1 is the non-primary key).
    Figure 3 Initial data
  • Perform the following operations on both databases:
    • dr1: insert into dr1 values(101, 100);
    • dr2: insert into dr2 values(101, 102);
  • After the operations are performed, the data in the databases is shown in the following figure.
    Figure 4 Data in the dr1 database
    Figure 5 Data in the dr2 database

Scenario 3: In dual-active DR mode, DDL operations are performed. As a result, data records become inconsistent.

  • Perform the following operations on both databases:
    • dr1: truncate table dr1;
    • dr2: insert into dr2 values(5,5,5);
  • After the operations are performed, the data in the databases becomes inconsistent.
    Figure 6 Data in the dr1 database
    Figure 7 Data in the dr2 database

    More scenarios are being added.