Remote Data Synchonization

The Remote Data Synchronization (RDS) Add-on is used to synchronize data between two different websites. It has two components, the requester and the responder.

The RDS Requester is a process add-on that executes on a schedule and follows a set of instructions located in the RDS Setup page. These instructions can run database commands locally, or request data from a remote data source and store it locally.

The RDS Responder is a remote method add-on that responds to requests from remote systems. The instructions describing how it responds are stored in a content table called RDS Response Tasks.

In many cases, a site would only use one of the two components. It would communicate with a remote datasource, perhaps with another Contensive website using the other component.

SyncContent Example

SyncContent would be used to
synchonize two Contensive sites. In this example, we will synchronize the organization tables. System A
would be considered the source of the data, or the Authoritative data
source. System B needs to synchronize it's data with that of System A.

System
A will be the Responder. When data is requested from it, it responds
with an XML data stream. System B would be the Requester.Periodically, it requests data from the responder, and saves the data to it's tables.

The first step would be to install the Remote Data Synchronization components on both systems using the Add-on Manager.

Next,
go to the Responder, System A. We will create a responder task so when
requested, System A will respond with an xml stream containing the
authoritative data needed by System B. On the Navigator, Open Manage
Add-ons > Remote Data Synchronization > RDS Response Tasks.
Create a new task called GetOrg, and paste these instructions:

Next,
go to the requester, system B. Here we will create a scheduled event
that periodically requests data from system A, and stores the data
received. On the Navigator, Open Manager Add-ons > Remote Data
Synchronization > RDS Request Tasks. Add a new record, set it
enabled and paste in these instructions:

Change
the domain of the URL to be the URL of system A. Now on the same setup
page, check the task enabled, and set the interval for 0. This forces
the task to execute every minute. You can now wait a minute, and system
b will request data from system a. System A will respond with an XML
stream, which system B then updates it's data with the stream.

SyncTable Example

SyncTable would be used if you were synchonizing a Contensive site to a non-Contensive remote data source. In that case, either the requester or the responder would be the Contensive RDS add-on, and the other end would be the RDS-ODBC stand-alone server. To keep this example simple, lets just consider two websites that need to synchronize their member email lists. System A would be considered the source of the data, or the Authoritative data source. System B needs to synchronize it's data with that of System A.

System A will be the Responder. When data is requested from it, it responds with an XML data stream. System B would be the Requester. Periodically, it requests data from the responder, and saves the data to it's tables.

The first step would be to install the Remote Data Synchronization components on both systems using the Add-on Manager.

Next, go to the Responder, System A. We will create a responder task so when requested, System A will respond with an xml stream containing the authoritative data needed by System B. On the Navigator, Open Manage Add-ons > Remote Data Synchronization > RDS Response Tasks. Create a new task called Getpeople, and paste these instructions:

Next, go to the requester, system B. Here we will create a scheduled event that periodically requests data from system A, and stores the data received. On the Navigator, Open Manager Add-ons > Remote Data Synchronization > RDS Request Tasks. Add a new record, set it enabled and paste in these instructions:

Change the domain of the URL to be the URL of system A. Now on the same setup page, check the task enabled, and set the interval for 0. This forces the task to execute every minute. You can now wait a minute, and system b will request data from system a. System A will respond with an XML stream, which system B then updates it's data with the stream.

The following shows the instructions possible in both the requester and responder task lists.

Requester Task Reference

TaskThe required top node. Contains nodes that describes an action to be carried out. There can be a sequence of tasks in a task list.

NameThe name of the task

SyncTableRequests a dataset from a remote datasource, and describes how that data will be saved when it is received

URLThe url used to request the data from the remote source. For instance, to get data from the 'GetPeople' task of the RDS responder on Beta.Contensive.com, use http://beta.contensive.com/RDSResponder?task=GetPeople

NameThe name of the local table where the data will be stored when it is returned

KeyThe name of the field in the database table that will be used as the key. The key field is the one that will determine if the incoming record matches a current record. For instance, if the incoming data contains a field name 'emailAddress' and you want that to be used to detect matching records with the 'email' field in your table, use 'email' as the key.

RowAliasThe xml node that represents a row in the incoming data. The default is 'row'. Use this rowalias node if the data you are requesting is coming from a non-Contensive stream with different node names.

FieldEach field node maps a field in the incoming data to a field in your database. For instance, if the incoming data contains 50 fields, but you only want to collect five of them, configure five field nodes.

NameThe name of the field in your database where the data will be stored

AliasThe name of the node in the incoming stream for this data

TypeThe type if data to be stored. Value types are:

Text

Date

Boolean

Integer

Number

TextFile

ValueThis is the defaul value to use if the incoming data does not contain this field

RunSQLExecutes a database sql statement

SQLThe database sql statement to run

SyncContentRequests a dataset from a remote datasource, and describes how that data will be saved when it is received.

URLThe url used to request the data from the remote source. For
instance, to get data from the 'GetPeople' task of the RDS responder on
Beta.Contensive.com, use
http://beta.contensive.com/RDSResponder?task=GetPeople

NameThe name of the local content table where the data will be stored when it is returned

KeyThe
name of the field in the content table that will be used as the
key. The key field is the one that will determine if the incoming
record matches a current record. For instance, if the incoming data
contains a field name 'emailAddress' and you want that to be used to
detect matching records with the 'email' field in your table, use
'email' as the key.

RowAliasThe xml node that
represents a row in the incoming data. The default is 'row'. Use this
rowalias node if the data you are requesting is coming from a
non-Contensive stream with different node names.

FieldEach
field node maps a field in the incoming data to a field in your
database. For instance, if the incoming data contains 50 fields, but
you only want to collect five of them, configure five field nodes.

NameThe name of the field in your content table where the data will be stored

AliasThe name of the node in the incoming stream for this data

ValueThe default value to use if the incoming data does not contain this field

Responder Task Reference

TaskThe required top node. Contains a sequence of commands to be executed when the responder is requested.

RunSQLExecutes a database sql statement

SQLThe database sql statement to run

SyncTableSelects records from the database, and formats them for delivery to a remote requester

SQLThe database query that gathers the data to be sent in the data stream

RowAliasThe xml node that represents a row in
the outgoing data. The default is 'row'. Use this rowalias node if the
data you are sending does not go to a Contensive RDS Requester.

FieldEach field node maps a field
in the incoming data to a field in your database. For instance, if the
incoming data contains 50 fields, but you only want to collect five of
them, configure five field nodes.

NameThe name of the field in your database query

AliasThe name of the node in the data stream for this field

TypeThe type if data to be sent. Value types are:

Text

Date

Boolean

Integer

Number

TextFile

SyncContentSelects records from a content table, and formats them for delivery to a remote requester.

SQL CriteriaThe criteria portion of the content select. For instance, if your content table is 'people', and you only want people with an email address, the criteria might be 'email is not null'

NameThe name of the local content table where the data will be read

RowAliasThe xml node that
represents a row in the incoming data. The default is 'row'. Use this
rowalias node if the data you are requesting is coming from a
non-Contensive stream with different node names.

FieldEach
field node maps a field in the incoming data to a field in your
database. For instance, if the incoming data contains 50 fields, but
you only want to collect five of them, configure five field nodes.

NameThe name of the field in your content table where the data will be stored