Subject | Re: [firebird-support] Replicator pseudo-code (sorry, it's a little long...) |
---|---|
Author | Milan Babuskov |
Post date | 2004-01-21T13:50:46Z |
Nigel Weeks wrote:
What happens if time on server is changed?
How do you sinc the servers?
My suggestion is to use generators, actually a single generator.
You can have a single one column table with one value: last replicated
generator_id. Then just query each table if it has gen_id larger than
that number.
Other things seem ok. Except one thing. It doesn't support conflicting
updates. I define "conflicting updates" like this:
At server A record X is changed to value y.
At server B record X is changed to value z.
When B receives updates from A, it could detect that it also has changed
record X since the last replication, and if the values are different
(A.new_x != B.new_x) it should issue the warning.
Well, just my ideas.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net
> Each database that mod_repl hooks into MUST HAVEWhy timestamp?
> int_siteid INTEGER NOT NULL,
> dtm_rstamp TIMESTAMP DEFAULT 'now',
> ...
> in every table.
What happens if time on server is changed?
How do you sinc the servers?
My suggestion is to use generators, actually a single generator.
> Change log tables have to be produced for each table in the database,Same here.
> Each log table has the all the fields of the table, and the GMT of the
> change(timezone independent)
> ------ Begin Pseudo ------How do you plan on doing this?
> The 'Collector' queries each database, and retrieves any new changes.
You can have a single one column table with one value: last replicated
generator_id. Then just query each table if it has gen_id larger than
that number.
Other things seem ok. Except one thing. It doesn't support conflicting
updates. I define "conflicting updates" like this:
At server A record X is changed to value y.
At server B record X is changed to value z.
When B receives updates from A, it could detect that it also has changed
record X since the last replication, and if the values are different
(A.new_x != B.new_x) it should issue the warning.
Well, just my ideas.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net