At dealnews we have three tiers of servers. First is our
development servers, then staging and finally production. The
complexity of the environment increases at each level. On a
development server, everything runs on the localhost: mysql,
memcached, etc. At the staging level, there is a dedicated MySQL
server. In production, it gets quite wild with redundant services
and two data centers.
One of the challenges of this is where and how to store the
connection information for all these services. We have done
several things in the past. The most common thing is to store
this information in a PHP file. It may be per server or there
could be one big file like:
<?php
if(DEV){
$server = "localhost";
} else {
$server = "10.1.1.25";
}
?>
This gets messy quickly. Option two is to …