As an aside, don't expect to turn on mysql replication and have applications magically start syncing between sites.

I have yet to find an easy transparent mysql replication layer that you can plug underneath existing applications without things dying horribly.

The only way I've managed to get something like this to work on in house applications is active/slave and then I had to rewrite all the database calls so that all the reads came from the local slave and the writes went to the master for the remote sites.

You could in theory use MySQL clustering but my head exploded when I tried to implement that without code changes. Its much easier to designate one box as the "all writes happen here" and use the slaves as read slaves.

Its also nice to turn on replication to have a slave for backups so you can do mysql dumps on large tables without impacting performance on the main host.

Wayne Merricks
The Voice Asia

On 03/03/14 16:28, Fred Gleason wrote:
On Mar 3, 2014, at 10:46 49, Cowboy <c...@cwf1.com> wrote:

If you were so inclined, you could check and compare the timestamps
on the files in /var/lib/mysql/databasename/tablename.MYI between the
two ( or three, or... ) machines and know which is the most recent
No, No, NO - you do *not* want to do this!  MySQL makes extensive use of 
internal file caching as a technique for boosting performance.  The only time 
that the timestamps on the actual files can be taken as indicative of the true 
state of things is after doing a FLUSH TABLES WITH READ LOCK call (perhaps — 
InnoDB tables can get you in trouble here) or ideally if the mysqld(8) daemon 
is shut down.

A setup where two MySQL instances update each other is known as ‘active-active 
replication’.  It can be done, but it requires careful application design to 
ensure that updates to a particular table are wholly confined to one or the 
other of the instances (a technique known as ‘data sharding’).  The consequence 
of violating this rule can be data collisions in things like column 
auto-increment values, which in turn will halt replication and require manual 
intervention to recover from the inconsistent state.

Cheers!


|-------------------------------------------------------------------------|
| Frederick F. Gleason, Jr. |               Chief Developer               |
|                           |               Paravel Systems               |
|-------------------------------------------------------------------------|
| Like the ski resort of girls looking for husbands and husbands looking  |
| for girls, the situation is not as symmetrical as it might seem.        |
|                                        -- Alan McKay                    |
|-------------------------------------------------------------------------|

_______________________________________________
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

_______________________________________________
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to