tags:

views:

38

answers:

2

Best tutorial around for understanding how to set up a separate SQL server besides my regular web server? Want to run an application with a huge DB.

A: 

Try memcached among with mysql native query cache support. Memcached allows you to store anything on memory (including query results) in order to avoid doing the same heavy query on tables that haven't changed.

Having a separated server will make the connection latency generally slower, so unless your database is not only huge but has a real high load of queries it won't be necessary.

Rodrigo
If the second server is on the same ServiceNet, and private IP addresses can be used, then I doubt there'll be much (if any) decrease in speed!
chigley
So i think I'll go with your idea just to start with-I'll try not running a different server. Let's see how it goes.
LektoFrizba
A: 

There's no real need for a tutorial, actually. When you connect to an sql database with PHP you use the following line:

$db_handle = mysql_connect($host, $user, $password);

Note the "$host" variable. This is normally set to "localhost" ("this computer"). It's just as easy to change it to "mysql.mysite.com" and have the subdomain point to a separate server. At that point it's just a matter of

  1. Installing SQL on the second server

  2. Setting up the CNAME records to point to the second server.

steven_desu
Gotcha. thanx a lot!
LektoFrizba