Posted by: Dylan Jennings
Date: December 17, 2009 08:36PM
Usually, there would not be much point in doing what I am trying to do, but let me explain.
I have 2 game servers which run off a MySQL database. At the moment, both servers are using server A to do all the MySQL queries. The problem is, server B is in Germany, and server A is in California, so whenever a MySQL query is run on server B, there is a short lag, which is noticeable when in-game.
What I want to do, is run the main MySQL server on server A, and a sort of "clone" on server B, so whenever I execute any commands on server B, they will instantly take effect on server A, too. So, I need both databases to be completely identical, so that server B can use its local database, while server A submits any changes to the database to server B, and vice versa. Thus, removing the lag from in-game, and transferring it to a separate process.
This is how it is at the moment:
Player 1 joins server A, and logs in. The query is local, and very fast.
Player 2 joins server B, and server B fetches login data from server A on-the-spot, creating a lag.
I want it to be like this:
Player 1 joins server A, and logs in. The query is local, but if any changes are made to server A's database, they are submitted to server B.
Player 2 joins server B, and logs in. The query is local, but if any changes are made to server B's database, they are submitted to server A.
The databases are now identical.
Any help would be appreciated.