My questions concern a setup where a public server is running at our
hosting company and a local office server is behind a firewall
(connected to the net via a somewhat unreliable ADSL).

The servers are configured in a circular master-slave relationship but
only a limited number of tables in the database are replicated between
the two (public doesn't need all of them, so no use in replicating). Of
these tables only 3 need to accept writes from both the public and
office server (all the other writes happen at the office). Of those 3
tables only 1 makes use of a unique primary key.


So my questions are:

1) Replicating a table with a primary key raises the possibility of
conflicts if, while the office link is broken, two records are created
with the same key. So I plan to generate my own keys in the project
source code (without auto_increment) - the public site generates records
with even numbers, the office site with odd numbers.

Is this a reasonable setup or is there a more correct way? Out of
interest, how will MySQL 4.0 replication handle this situation?


2) MySQL docs state "It is possible for client A to make an update to
co-master 1, and in the meantime, before it propagates to co-master 2,
client B could make an update to co-master 2 that will make the update
of client A work differently than it did on co-master 1. Thus when the
update of client A will make it to co-master 2, it will produce tables
that will be different than what you have on co-master 1, even after all
the updates from co-master 2 have also propagated."

Say the office link is down, and a particular record in the
above-mentioned table is edited on both the public and office servers.
When the servers re-sync will one record take precedence (if so, which
one?) or does the public get one and the office get the other? The
former seems to be the case when doing basic testing on my LAN at home,
but the MySQL doc is confusing in that it implies the latter.



To those of you who have read all the way down to here, I thank you very
much! :)

Cheers,
from Duncan Maitland
[EMAIL PROTECTED]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to