View previous topic :: View next topic |
Author |
Message |
mc_bluebeard n00b
Joined: 12 Jun 2003 Posts: 59 Location: Cambridge, MA USA
|
Posted: Sat Jul 29, 2006 1:59 pm Post subject: How to create "concurrent" databases between dista |
|
|
Hi!
My company is creating a database application for internal use and the database needs to be accessed and changed from China and the U.S. It would be great if there were two machines w/ the database: one here (U.S.) and on there and if they were kept "concurrent."
The problem is that, changes would be made to either copy...etc.
Is this possible? Advice appreciated....Thx! _________________ I do not belong on this mission and I want to return to earth. |
|
Back to top |
|
|
sonicbhoc Veteran
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Sat Jul 29, 2006 2:02 pm Post subject: |
|
|
I don't exactly get what you're trying to do, but maybe rsync could help? |
|
Back to top |
|
|
Fanatic Apprentice
Joined: 02 May 2004 Posts: 173 Location: Stocktown
|
Posted: Sun Jul 30, 2006 5:26 pm Post subject: Re: How to create "concurrent" databases between d |
|
|
mc_bluebeard wrote: | Hi!
My company is creating a database application for internal use and the database needs to be accessed and changed from China and the U.S. It would be great if there were two machines w/ the database: one here (U.S.) and on there and if they were kept "concurrent."
The problem is that, changes would be made to either copy...etc.
Is this possible? Advice appreciated....Thx! |
You're probably best off checking out the clustering capabilites of some commercial RDBMS'es (Oracle, DB2 etc) |
|
Back to top |
|
|
MrUlterior Guru
Joined: 22 Mar 2005 Posts: 511 Location: Switzerland
|
Posted: Mon Jul 31, 2006 3:10 pm Post subject: |
|
|
Offhand, these're the solutions I would investigate:
Solution 1 (3 MySQL instances)
The principle is you have 2 slaves nodes, these serve readonly queries (ie SELECTS) to your application & the master node which receives INSERT, UPDATE etc statements. Then the master replicates to the slaves. One physical server could contain both master and a slave node on different ports/sockets.
(see http://dev.mysql.com/doc/refman/5.0/en/replication.html)
Solution 2 (Distributed application)
Your application never directly interacts with a database. Instead it interacts with a web service (or similar) which serves back data in XML. These "controllers" intercommunicate via XMLRPC or similar to ensure records are locked for writing on both servers, whilst the server recieving the request first writes changes locally then forwards the request to the remote server; which then unlocks the record(s) in question. This would of course need to be combined with a FIFO queue on both controllers to handle requests for locks and/or updates, ....
Solution 3 (MSSQL Merged replication)
2 SQL Servers with Merge replication. Note that this tends to have serious issues with lossy connections (I manage 15 pairs of merged MSSQL server, so I speak from experience here ... )
IMHO solution 2 is best as it will scale better, cost less, perform as well as you build it and not leave you locked into an RDBMS vendor. Solution 1 & 3, typically arise because of bad design and/or not catering for future needs. _________________
Misanthropy 2.0 - enough hate to go around
|
|
Back to top |
|
|
Fanatic Apprentice
Joined: 02 May 2004 Posts: 173 Location: Stocktown
|
Posted: Mon Jul 31, 2006 3:44 pm Post subject: |
|
|
MrUlterior wrote: | Offhand, these're the solutions I would investigate:
Solution 2 (Distributed application)
Your application never directly interacts with a database. Instead it interacts with a web service (or similar) which serves back data in XML. These "controllers" intercommunicate via XMLRPC or similar to ensure records are locked for writing on both servers, whilst the server recieving the request first writes changes locally then forwards the request to the remote server; which then unlocks the record(s) in question. This would of course need to be combined with a FIFO queue on both controllers to handle requests for locks and/or updates, ....
|
That seems.. complex. |
|
Back to top |
|
|
mc_bluebeard n00b
Joined: 12 Jun 2003 Posts: 59 Location: Cambridge, MA USA
|
Posted: Mon Jul 31, 2006 11:57 pm Post subject: ugh! |
|
|
way complex! option #1 seems best to me re: simplicity.
does something like Oracle support mirrorered DB's sans all the complexity?
thx! _________________ I do not belong on this mission and I want to return to earth. |
|
Back to top |
|
|
MrUlterior Guru
Joined: 22 Mar 2005 Posts: 511 Location: Switzerland
|
Posted: Tue Aug 01, 2006 5:57 pm Post subject: |
|
|
Fanatic wrote: | That seems.. complex. |
Not if the goal is a distributed application, which it seems this is. _________________
Misanthropy 2.0 - enough hate to go around
|
|
Back to top |
|
|
|