Thanks Alec,

how is a bank system implemented? do they have just one master sever and all the other servers are slaves?

you solution is not bad and I should think more about it. it's close to one of my solutions: I should convert the database to InnoDB. when a user in location A needs to update or add a new record, the program in background should lock the record in all 3 locations. if it is successful, then user in A can change the data and program should update all 3 locations. if updating has any problem, send rollback command to the other locations. I should have a commands waiting list. if update command could get through but rollback could not, after connection backed, send it to the server. then I should think about how to solve dead lock (if location A send lock to B, and C and before release the lock, connection gone. then B and C should not be locked forever :>

anyways, it's complicated.

----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, November 18, 2004 9:34 AM
Subject: Re: 2 ways Replication in MySQL



"Mojtaba Faridzad" <[EMAIL PROTECTED]> wrote on 18/11/2004
13:59:21:

Hi,
I need to expand the database to 3 different locations. We have 3
servers in
3 cities. So far the database has been in one city and 2 others have
been
linked to it and worked. But sometimes for a day or more a city lost the

connection to the master database and the users could not work. Now I am

going to change the method to have a copy of database on each location.
Each
location should be able to change the data also. All tables are myISAM.
I am
thinking about 2 ways Replication in MySQL but as MySQL document
recommended
not to do it because there is no guarantee that we won't have any
problem
(slow connection or losing connection in a period of time).

Have you ever had this kind of situation? How did you solve it? Have you

ever found any problem in your solution?

What you are attempting to do is inherently difficult, and I don't think any DBMS has solved it. What do you expect to happen if the links between cities are down, and the *same* row in the database is updated differently by different users? Even when the link is up, you have the possibility of a race condition if users in different places update records within a narrow window.

The closest we got to this was having a master database in one place and
read-only slaves in another. UPDATE commands were always sent to the
master copy, and could not be done when the link was down. SELECTs were
sent to the local slave and could therefore continue when the link was
down. At the application level, we pipelined a few necessary but
uncomplicated updates to be done when the link returned.

       Alec

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]






-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to