Chapter 7. SQL Remote Design for AdaptiveSer verAnywhere
Thesekey features of relational databases must be incorporated into the
designof your publications and subscriptions. Thissection describes
principlesand techniques for sound design.
Conditions for valid articlesAllcolumns in the primary key must be included in the article.
Supporting INSERTS at
remotedatabases ForINSERT statements at a remote database to replicate correctly to the
consolidateddatabase, you can exclude from an article only columns that
canbe left out of a valid INSERT statement. These are:
♦Columnsthat allow NULL.
♦Columnsthat have defaults.
Ifyou exclude any column that does not satisfy one of these requirements,
INSERTstatements carried out at a remote database will fail when
replicatedto the consolidated database.
Consolidated ID Rep
Ann
2
1
Marc
Remote ID Rep
2
1 Ann
Marc
Dept
101
101
3 Shih
3 Shih X
INSERT
INTO SalesRep (ID, Rep)
VALUES (3, 'Shih' )
INSERT
INTO SalesRep (ID, Rep)
VALUES (3, 'Shih' )
Insert fails
Insert
succeeds
UsingBEFORE triggers as an alternative
An exceptionto this case is when the consolidated database is an Adaptive
Server Anywhere database, and a BEFORE trigger has been written to
maintainthe columns that are not included in the INSERT statement.
Design tips for performanceThissection presents a checklist for designing high performance
SQLRemote installations.
103