designing for scalability and flexibility


fyi: managed dns services - edgedirector.com

Always remember that any ip address can be pointed to by multiple dns names. Also remember that all modern web server can be configured to accept multiple host headers, or even no host header at all.

When designing a web site with high traffic potential it is worth incorporating these facts into the initial design. This is especially true since incorporating a proper separation of hosts carries no initial cost but carries heavy costs in a retrofit.

You only need to decide upon a set of server names to use for the content elements that comprise your site. Some developers call the static elements "site furniture".

Many sites make use of static html, scripts, forms, images, style sheets and external javascript somewhere in their design. In that case, it might be wise to separate the many files onto separate server names, even though these server names are in reality the same server.

The advantage of doing this is that as traffic grows, the various element categories can be migrated onto their own servers transparently without any retrofit beyond changing a dns entry.

An example naming structure for the site at example.com might be:

www.example.com base web site
cgi.example.com/cgi/ forms target
css.example.com/css/ style sheets
lib.example.com/lib/ javascript files
img.example.com/img/ images
php.example.com/php/ php dynamic pages

In the above example, even when all the host names point at the same server, the folder placement will retain separation of the various file categories. When it becomes necessary, just copy the folder to a new server and change the appropriate dns record.

There is a further immediate benefit in this design pattern. It permits a larger number of concurrent browser connections during the loading of page elements.

Internet Explorer, and perhaps some other browsers, limits the number of connections to a single host as defined by it's fully qualified domain name. However, each fqdn gets it's own allotment of connections. So, if there is a limit of two connections per fqdn, the browser can potentially open two connections times the number of unique hosts represented by their fqdn. This is true even if they are the same server at the same ip address. This concurrency helps to mask the effects of network latency.