Article View: borland.public.interbase.replication
Article #171Replication techniques
From: Jonathan Neve
Date: Fri, 22 Aug 2003 06:46
Date: Fri, 22 Aug 2003 06:46
38 lines
2872 bytes
2872 bytes
Hi! I've been thinking about designing a replicator. I've come across a problem. I was thinking of using triggers to generate a log of all changes in a log table in the database (I think this is how other replicators work, right?). However, I need to do 2-way replication. So when database A receives a change from database B, it will apply the changes to itself. But then, the triggers will get fired in database A, and the same change will get sent back to database B. How can this sort of thing be prevented? Also, another similar problem I've run into, is that if I have triggers for synchronising all data tables, what happens if there are already other triggers? For example, suppose table A has an After Update trigger that inserts data into table B. If I use triggers to generate the log, I will get the update statement for table A as well as the insert statements for table B. However, when the changes are applied on the other database, the inserts on table B will be done twice due to the triggers! How can I get around this? Is there any alternative to using triggers? What do other replicators do? I've found a way to overcome such problems as conflicts in primary keys, foreign keys, and concurrent updates and deletes (using a lock table in the main database). So with a bit of recoding, I should be able to adapt my application to that fairly easily. All I'm missing now is to overcome a few technical barriers... I need to have 4 databases entirely synchronized. Currently, the remote clients are connected directly to the main database via an ADSL connexion. But as this is too slow. So using the permanant connexion, I should be able to solve all potential conflicts. Any help would be greatly appreciated! Thanks! Jonathan Neve.
Technical Details
Message-ID:
<3f45bc5d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-out.superfeed.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f89d7,b1ab3f5d8eb439e6,start X-Google-Attributes: gidf89d7,public X-Google-ArrivalTime: 2003-08-22 00:12:58 PST Date: Fri, 22 Aug 2003 08:46:47 +0200 From: Jonathan Neve <jonathan@!nospam!microtec.fr> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.interbase.replication Subject: Replication techniques Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.11.22.149 Message-ID: <3f45bc5d@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1061534813 213.11.22.149 (21 Aug 2003 23:46:53 -0700) Lines: 39 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-out.superfeed.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail