Real-Time Backup Deployment Models
Deployment Models for Real-Time Backup
The following topics discuss deployment methods for Real-Time Backup replication, as well as disaster recovery steps in the event you need to restore a replicated database:
Real-Time Backup Configurations
This topic presents two types of configuration of DataExchange Real-Time Backup.
The first one is by far the most commonly used.
Two-Machine Configuration
In its two-machine configuration, Real-Time Backup replicates data in real-time from a PSQL database to a standby server. Upon a system failure, clients can be directed to the standby server. This type of configuration allows DataExchange to avoid errors common to disk-based replication tools, such as replicating corrupt data, spreading viruses, or deleting desired data. With DataExchange powering a standby server, data loss and down time are greatly lessened in the event of system failures, hardware failures, or site disasters.
The following figure illustrates this 1-way replication backup.
Figure 1 Real-Time Backup with Two Machines
In this scenario, Server A is networked with a backup server. The server runs its own database, dbA. DataExchange maintains a copy of the dbA database on the standby backup server and replicates with the Server A when changes occur there.
Simple, 1-way replication deployment between two machines is the standard use case for Real-Time Backup. This scenario involves a primary server and a backup server, as shown in Figure 1.
Many-to-One Configuration
The other configuration used with Real-Time Backup consists of several database servers at different locations that replicate data to a backup standby server hosting multiple backup databases. This is referred to as a many-to-one configuration. The following diagram illustrates this configuration.
Figure 2 Real-Time Backup with Many-to-One Configuration
In this scenario you have three servers, Server A, Server B, and Server C. Each machine is networked with your backup server. Each server runs its own database, dbA, dbB, and dbC, respectively. DataExchange maintains a copy of each database on the standby backup server and replicates changes on Server A, Server B, and Server C to their backup copies.
See Many-to-One Deployment Using DXdeploy for instructions on implementing Real-Time Backup on a many-to-one configuration using DXdeploy.
Many-to-One Deployment Using DXdeploy
In a many-to-one configuration, multiple sites back up data to a single site. A good choice for a First Site in such a configuration is often the backup location. Consider the following example scenario:
Figure 3 Multiple Sites Backing Up Data
Three servers, A, B, and C, each has its own network. Each server runs its own database, dbA, dbB, and dbC, respectively. You want to implement a solution in which a replicated copy of each database is maintained on one backup machine.
Given this scenario, the most reasonable choice for the First Site is the backup location. Why? Part of the reason is that a replication network can have only one First Site. In addition, the backup location meets the following criteria:
The following image shows the same configuration after you install DataExchange. Note that the Partner Sites are the sources of the data and the First Site is the backup location.
Figure 4 Many-to-One Configuration with DataExchange Installed
Note In the reverse of a many-to-one configuration, one First Site source replicates to two or more Partner Site backups.
Before You Get Started
Before performing this task you must install DataExchange on a First Site and a Partner Site.
Tip So that you can restore your databases to their original state after this exercise, we recommend saving a copy of the Demodata database files before proceeding with this example.
For discussion purposes, this task assumes the following:
Caution All applications using the database must be shut down before using this deployment method.
Deploying Using DXdeploy
 
1
For example, suppose that Demodata is the database used by Myapp.exe. Ensure that Myapp is not accessing Demodata while you perform the steps to deploy Demodata.
2
On the backup (First) site, open the XML descriptor file EXPRESS.XML in a text editor. On a 64-bit system this file is found in C:\Program Files (x86)\Actian\PSQL\Replication\Docs.
3
Note that you will edit, and use, a different descriptor file for each Partner Site. Because the backup (First) site is a shared location, some information in the descriptor file must be unique each time that you use the file. The following table explains this.
4
Save EXPRESS.XML as ServerA.xml to a location of your choice. This example assumes C:\.
5
The backup location must be unique and must match the location for First Site DataDirectory in the XML descriptor file. This task assumes that the backup location is C:\Demodata_Backup_ServerA.
6
dxdeploy /Site=First C:\ServerA.xml
7
Press Enter.
DXdeploy provides high-level status messages on the screen as it completes its actions. DXdeploy is complete when the command prompt reappears.
8
dxdeact <First Site DSN>
<First Site DSN> is the DSN you specified in ServerA.xml for the First Site.
9
Press Enter.
10
Note For a many-to-one configuration, ignore the replication template created on the backup (First) site. Instead, use the files for the activated database, which are located in the DataExchange directory.
11
12
dxact /FIRSTSITE <First Site DSN>
<First Site DSN> is the DSN you specified in ServerA.xml for the First Site.
13
Press Enter.
14
dxdeploy /Site=Partner C:\ServerA.xml
15
Press Enter.
DXdeploy provides high-level status messages on the screen as it completes its actions. DXdeploy is complete when the command prompt reappears.
16
See Managing Replication Schedules for how to set up a replication schedule.
17
18
Repeat steps 1 through 17 for each of the other Partner Sites.
Substitute ServerB for ServerA when repeating the steps for ServerB. Substitute ServerC for ServerA when repeating the steps for ServerC.
Disaster Recovery
This topic explains how to recover from the failure of one replication site. The information assumes that the disaster occurs to your primary site, requiring that you temporarily switch production to your backup site. After a primary site is again provided, you then need to reestablish the primary site/backup site replication network.
A disaster could, of course, occur to the backup site. The information still applies; just substitute backup for primary. For ease of discussion, and to remain consistent with terminology commonly used to discuss disaster recovery, this topic refers to primary site and backup site. Think of them as the First Site and Partner Site, respectively.
The information here applies only to a real-time backup situation or to a 1-way situation. See Deployment Process for an explanation of real-time backup deployment. See 1-Way Deployment Using DXdeploy for a working example of 1-way deployment.
Failover
In the event of a disaster, you must switch your users to access the backup site. Use whatever methods are in place at your company to accomplish switching to a different server. Such methods are many and varied and beyond the scope of this document.
Since the backup site contains current data, your application should continue to function as before.
Once your users are accessing the backup site, reestablish your First Site. Two disaster scenarios exist pertaining to the data on the primary site:
No Data Recoverable
Use the following steps to reestablish your primary site.
1
2
If the system was a First Site before, install a First Site. If it was a Partner Site, install the Partner Site.
3
This creates a fresh copy of your application database on the new machine.
4
5
You must ensure that the database is not being accessed until you get the primary and backup sites synchronized.
6
See dxdeact.
7
8
See dxact.
9
See dxact. Note that the activation on the backup site performs an initial replication with the primary site. An initial replication is a full replication, in which all data is synchronized between the two machines.
The primary site and backup site now contain the same data.
10
See Schedule Tasks.
11
Data Recoverable But Not Current
Use the following steps to reestablish your primary site.
1
2
Be sure that the database is not accessed until you get the primary and backup sites synchronized.
3
See Schedule Tasks.
4
Deactivate the replication database on both the primary and the backup sites.
See dxdeact.
5
See dxact.
6
See dxact. Note that the activation on the backup site performs an initial replication with the primary site. This is a full replication, in which all data is synchronized between the two systems.
The primary site and backup site now contain the same data.
7
See Schedule Tasks.
8