Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to create "concurrent" databases between distant places
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
mc_bluebeard
n00b
n00b


Joined: 12 Jun 2003
Posts: 59
Location: Cambridge, MA USA

PostPosted: Sat Jul 29, 2006 1:59 pm    Post subject: How to create "concurrent" databases between dista Reply with quote

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
View user's profile Send private message
sonicbhoc
Veteran
Veteran


Joined: 24 Oct 2005
Posts: 1805
Location: In front of the computer screen

PostPosted: Sat Jul 29, 2006 2:02 pm    Post subject: Reply with quote

I don't exactly get what you're trying to do, but maybe rsync could help?
Back to top
View user's profile Send private message
Fanatic
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 173
Location: Stocktown

PostPosted: Sun Jul 30, 2006 5:26 pm    Post subject: Re: How to create "concurrent" databases between d Reply with quote

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
View user's profile Send private message
MrUlterior
Guru
Guru


Joined: 22 Mar 2005
Posts: 511
Location: Switzerland

PostPosted: Mon Jul 31, 2006 3:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fanatic
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 173
Location: Stocktown

PostPosted: Mon Jul 31, 2006 3:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
mc_bluebeard
n00b
n00b


Joined: 12 Jun 2003
Posts: 59
Location: Cambridge, MA USA

PostPosted: Mon Jul 31, 2006 11:57 pm    Post subject: ugh! Reply with quote

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
View user's profile Send private message
MrUlterior
Guru
Guru


Joined: 22 Mar 2005
Posts: 511
Location: Switzerland

PostPosted: Tue Aug 01, 2006 5:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum