Why are some websites spread across www2, www3 sub-domains whilst others manage scaling without it?

20,473

www[n] is an easy way to add more more servers to cope with load since you can load balance very easily between the various servers - with www[n] you can just redirect the request to the appropriate server and forget about subsequent requests - because the client then deals with www1 or www2 etc... Adding more servers is simple... but it's non persistent in terms of subsequent requests

The alternative is for the load balancer to maintain a pool of backend nodes that are maintained "behind the scenes". It keeps track of which node the user has been allocated to - normally by using session cookies to identify which backend node the user has been allocated to. It just maintains a big in memory hashmap (effectively) of the session id's to backend nodes, delegating requests from a user's browser to the backend node each time... it's more complex to setup, but more powerful in the long run.

More info here: http://en.wikipedia.org/wiki/Load_balancing_%28computing%29

Share:
20,473
Ray
Author by

Ray

Technical Business Analyst / Senior Developer working for in Fund Management in the City of London. Currently working on enterprise datawarehouse hub, vendor feed integration, client reporting solutions. A large chunk of which is Salesforce and the Force.com platform. Pretty broad enthusiast for all sorts. Project experience across C#, ASP.Net, LINQ, SQL, C++, Java, Python, Ruby on Rails, PHP, ColdFusion. Spare time Assembler tinkerer.

Updated on November 27, 2020

Comments

  • Ray
    Ray over 3 years

    I know it's to do with having a variety of load balancing servers, but why do some sites make use of differently named "www" sub domains (www2.somesite.com, www3.somesite.com etc) where as other can be perfectly massive without doing this - ie all traffic is to www.hugesite.com.

    Does it indicate certain architectural decisions / have a specific purpose? Can it be avoided or is it a limitation of having the site scale a certain way?