Chapter 6. Principles of SQL Remote Design
How data types are replicated
Longbinary or character data, and datetime data, need special consideration.

Replication of blobs

Blobsare LONG VARCHAR, LONG BINARY,TEXT, and IMAGE data
types: values that are longer than 256 characters.
AdaptiveSer ver
Anywherereplication SQLRemote includes a special method for replicating blobs between
AdaptiveServer Anywhere databases.
TheMessage Agent uses a variable in place of the value in the INSERT or
UPDATEstatement that is being replicated. The value of the variable is built
upby a sequence of statements of the form
SET vble = vble || ’more_stuff’
Thismakes the size of the SQL statements involving long values smaller, so
thatthey fit within a single message. TheSET statements are separate SQL
statements,so that the blob is effectively split over several SQL Remote
messages.
AdaptiveSer ver
Enterprise replication Blobscan be replicated to and from Adaptive Server Enterprise as long as
theyfit into the Message Agent memory.
SybaseOpen Client CTLIB applications that manipulate the CS_IODESC
structuremust not set the log_on_update member to FALSE.
Usingthe
Verify_thresholdoption to
minimizemessage size
TheVerify_threshold database option can prevent long values from being
verified(in the VERIFY clause of a replicated UPDATE). The default value
forthe option is 1000. Ifthe data type of a column is longer than the
threshold,old values for the column are not verified when an UPDATE is
replicated. This keeps the size of SQL Remote messages down, but has the
disadvantagethat conflicting updates of long values are not detected.
Thereis a technique allowing detection of conflicts when Verify_threshold
isbeing used to reduce the size of messages. Whenevera “blob” is updated,
alast_modifiedcolumn in the same table should also be updated. Conflicts
canthen be detected because the old value of the last_modified column is
verified.
Usinga wor k tableto
avoidredundant updates Repeatedupdates to a blob should be done in a “work” table, and the final
versionshould be assigned to the replicated table. Forexample, if a
documentin progress is updated 20 times throughout the day and the
MessageAgent is run once at the end of the day, all 20 updates are
replicated. If the document is 200 KB in length, this causes 4 Mb of
messagesto be sent.
83