Offline vs. online replication, n-way
Submitted by admin on Fri, 2006-04-28 13:19.
Q: I have downloaded and tried IbReplicator, and I have a question about it:
Q: Ok, I set up this two way sync, make a change in the first, IbReplication will change it in the second, comes this change back in the first? Thus, circulate endlessly?
A: No that is not problem, you setup one SQL user e.g. 'IBREPL_1' for both schemes. Problem is: DB1 record changed (database1), corresponding DB2 record changed (database2). Replication 1-2 overwrites DB2. Next replication 2-1 will made dummy DB1 replication because DB2 is overwritten. Result changes made to DB2 disappears.
Q: How do you meen: "Result changes made to DB2 disappears"? You mean value for DB2 is overwritten by DB1? That's ok. But for offline sync, how do I set it up? For the master, only generate triggers etc for source db and make dummy db? And for target, make dummy source and generate for group/target db? Do I understand it right that it syncs on the db numbers? So for source a dummy 2, and target a dummy db1? (for an one way sync, for 2way the same principle?)
A: Overwrite problem:
or
More correct should be log an conflict error.
I don't know what you mean as Dummy database. In offline replication does exist source and target dbs (probably the same when starting). Create system objects (sch1) for source (DB1)(tables, triggers and access rights) and for target (DB2)(sch1) (rights and some tables). For opposite direction create sysobj for source (DB2) (sch2) and for target (DB1).
You must run pair of repl servers for each schema in offline replication.
Flow:
Q: What I meant with "dummy" database: I have 2 seperate databases on 2 servers. With no direct connection. How can I configure a target database, if I can't reach it? Same problem with target: it can't reach the source.
A: For installation you must of course reach target database to prepare system objects and machine (ibreplserver). Copy configuration database to 2nd machine as well. But you don't need BOTH source AND target databases online in one time from one spot. You can make setup the config databases have the same content (easier maintanace if you made changes in future).
Q: Thats what I meant for configuration:
A: Correct, you write config options to "dummy" databases. But it's just field in config database, connection is not used (established) on this side.
-
I want to use offline sync, how can I test it on my own pc? E.g. what are some default configs, do's and dont's?
I use it as two way sync? So duplex sync? (as far as it is possible) And how, do's and dont's?
Q: Ok, I set up this two way sync, make a change in the first, IbReplication will change it in the second, comes this change back in the first? Thus, circulate endlessly?
A: No that is not problem, you setup one SQL user e.g. 'IBREPL_1' for both schemes. Problem is: DB1 record changed (database1), corresponding DB2 record changed (database2). Replication 1-2 overwrites DB2. Next replication 2-1 will made dummy DB1 replication because DB2 is overwritten. Result changes made to DB2 disappears.
Q: How do you meen: "Result changes made to DB2 disappears"? You mean value for DB2 is overwritten by DB1? That's ok. But for offline sync, how do I set it up? For the master, only generate triggers etc for source db and make dummy db? And for target, make dummy source and generate for group/target db? Do I understand it right that it syncs on the db numbers? So for source a dummy 2, and target a dummy db1? (for an one way sync, for 2way the same principle?)
A: Overwrite problem:
Database 1 | Database 2 | Note |
---|---|---|
R1 | R1 | ; |
R1a | R1b | ; changed on both sides |
R1a | R1a | ; replication 1-2 |
R1a | R1a | ; replication 2-1 |
Database 1 | Database 2 | Note |
---|---|---|
R1b | R1b | ; replication 2-1 |
R1b | R1b | ; replication 1-2 |
-
Sch1-db1 replserver reads changes in db1 and prepares package and put it to shared media
sch1-db2 replserver read package from shared media and writes changes to db2, put some acknowledges to shared
sch1-db1 read acknowledges etc.
Q: What I meant with "dummy" database: I have 2 seperate databases on 2 servers. With no direct connection. How can I configure a target database, if I can't reach it? Same problem with target: it can't reach the source.
A: For installation you must of course reach target database to prepare system objects and machine (ibreplserver). Copy configuration database to 2nd machine as well. But you don't need BOTH source AND target databases online in one time from one spot. You can make setup the config databases have the same content (easier maintanace if you made changes in future).
Q: Thats what I meant for configuration:
-
install ibreplserver on DB1
config replication options**
prepare for logginginstall ibreplserver on DB2
copy config db
prepare for logging
A: Correct, you write config options to "dummy" databases. But it's just field in config database, connection is not used (established) on this side.