solidDB Help : Replication : Advanced Replication : Getting started with Advanced Replication: an evaluation setup : Designing a database table for synchronization
  
Designing a database table for synchronization
A database table that is used in a synchronized application has the following typical requirements:
The table must have a unique primary key to ensure global uniqueness of rows.
The table might need to have a row status column to provide a means for handling update conflicts.
The table should include a version number or the time of the last update to allow detection of update conflicts.
For more information, see Defining a database table.
The evaluation sample creates a table that meets the specified criteria, and contains the following columns:
REPLICAID: contains a unique identifier for the database. In the sample script, the value 1 is reserved for the replica database and value 2 for the master database.
ID: a row identifier that is unique inside the database where the row is created.
STATUS: a status field with the following values:
-1 for updates invalidated by the master database,
1 for tentative replica data,
2 for official master data.
INTDATA and TEXTDATA: contain the "business data" of the table.
Enabling the SYNCHISTORY property for the table enables incremental publication, which means that only the modified rows are transferred from the master database to the replica database when the table data is synchronized. For information about setting the SYNCHISTORY property, see ALTER TABLE ... SET SYNCHISTORY.
Setting the SYNCHISTORY property creates a "shadow table" for the SYNCDEMO main table. The name of the "shadow table" is the name of the main table with "_SYNCHIST_" prefix. Old versions of updated and deleted rows are moved to this shadow table. The SYNCHISTORY property must be set in both the master and replica databases.
As with any table to be synchronized, the table must be defined in both the master and replica databases.
Go up to
Getting started with Advanced Replication: an evaluation setup