Publications and Subscriptions v6.2

xDB Replication Server uses an architecture called publish and subscribe. The data to be made available for copying by a replication system is defined as a publication. To get a copy of that data, you must subscribe to that publication. The manner in which you subscribe is slightly different for single-master and multi-master replication systems.

In xDB Replication Server a publication is defined as a named set of tables and views within a database. The database that contains the publication is called the publication database of that publication.

In a single-master replication system, to get a copy of an xDB Replication Server publication, you must create a subscription. An xDB Replication Server subscription is a named association of a publication to a database to which the publication is to be copied. This database is called the subscription database.

Similar to a single-master replication system, when creating a multi-master replication system, you first define a publication in the publication database. You then add one or more additional databases that you want to participate in this multi-master replication system. As you add each database, it is associated with this replication system. You do not create an explicit, named subscription in a multi-master replication system.

In a single-master replication system, replication is said to occur when xDB Replication Server initiates and completes either of the following processes:

  1. applies changes that have been made to rows in the publication since the last replication occurred, to rows in tables of the subscription database (called synchronization); or
  2. copies rows of the publication to empty tables of the subscription database (called a snapshot). See Snapshot and Synchronization Overview for further discussion on snapshots and synchronization.

The subscription tables are the tables in the subscription database created from corresponding tables or views in the publication.

Note

In a single-master replication system xDB Replication Server creates a table in the subscription database for each view contained in the publication.

In a multi-master replication system, the concept and definition of replication is nearly identical to a single-master replication system with the following modifications:

  1. synchronization can occur between any pair of databases (referred to as primary nodes) participating in the replication system;
  2. a snapshot can occur from the publication database designated as the Primary Definition Node to any of the other primary nodes.

The following diagrams illustrate some basic single-master replication system examples.

The preceding diagram illustrates that a table that has been created as a member of a subscription can be used in a publication replicating to another subscription. This scenario is called cascading replication.

The following diagram illustrates a multi-master replication system with three primary nodes.

Publications in one database replicating to subscriptions in another database

Figure 2-1: Publications in one database replicating to subscriptions in another database

Publications replicating to two subscription databases

Figure 2-2:Publications replicating to two subscription databases

*Publications in two databases replicating to one subscription database*

Figure 2-3: Publications in two databases replicating to one subscription database

*Cascading Replication: Tables used in both a subscription and a publication*

Figure 2-4: Cascading Replication: Tables used in both a subscription and a publication

The preceding diagram illustrates that a table that has been created as a member of a subscription can be used in a publication replicating to another subscription. This scenario is called cascading replication.

The following diagram illustrates a multi-master replication system with three primary nodes.

*Multi-master replication system*

Figure 2-5: Multi-master replication system