Multiple Servers - One Database (PHP)

For discussions about game development that does not fit in any of the other topics.
Post Reply
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Multiple Servers - One Database (PHP)

Post by vitinho444 »

Hello community!

I was wondering, if i could improve my browser game's performance by using multiple servers ( free / non-free) hosts but all connected to my main website database, where all the information is held.

Is this possible with PHP and MySQL?

PS: I was thinking of this because if a chinese player wants to play my game that is hosted in the UK, it would be better to have a Chinese Server connected to the central DB in high speed, working as a middle man.
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Multiple Servers - One Database (PHP)

Post by Jackolantern »

Most definitely :) It is an entire aspect of server and database administration called "clustering". Any server or database that is expected to work for companies in an enterprise environment must be able to support clustering.

I have never done this with Apache web server before, but I know it is possible. People would make a request to your main IP address, and then...something...would decide which Apache server to send the request to. I actually don't know what that something is though haha, but it is probably all done within Apache. But sharing a database is easy. In PHP you select where the database server is you are connecting to. WAMP and XAMPP automatically set it to local host, but you would just change it to the IP address of your database server. Of course you would probably need to cluster the database since the database is oftentimes a larger bottleneck than Apache and the PHP module.
The indelible lord of tl;dr
Post Reply

Return to “General Development”