Client-Side Load Balancing: The Secret to Web 2.0 Performance?

As Web 2.0 applications become more popular, the issue of performance inevitably rears its ugly head. Ajax-driven sites, by their very nature, tend to be more efficient by loading content asynchronously and updating only portions of a page. However, if the server does not respond quickly enough, even Ajax won’t help your Web app’s speed.

Two time-tested solutions to this problem are load balancing requests across multiple servers, or distributing content via content delivery networks (CDNs). Both approaches seek to improve responsiveness on the server side, and each is useful for different types of applications. Load balancing sends browser requests to different machines within the same hosting environment, which is best for processor-intensive operations that may tie up server resources. CDNs distribute content across geographically dispersed servers, which is perfect for static content, video, or other bandwidth-intensive data.

Earlier this month Digital Web posted an article about a third option: client-side load balancing. While not everyone agrees with this approach, it offers an intriguing alternative to traditional Web scalability solutions.

Here’s how it works: When the browser makes a request to a site’s URL, the site sends back JavaScript code which loads a list of alternate subdomains within the same domain. For example, if the primary domain is at mysite.com, the alternate servers might be at s1.mysite.com, s2.mysite.com, etc.

The JavaScript code running on the browser can then request content dynamically from a randomly selected server on the list. If one server does not respond within a predefined timeout period, the browser can request content from the next server in the list.

Not only will this distribute load among multiple servers, the servers can be geographically distributed in different data centers. It also handles failover gracefully. But the best thing about this approach is that it can be combined seamlessly with server-side load balancing or CDNs to maximize performance and uptime.

Comments

Returning visitor? Please login or register.

Be the first to comment!

Leave A Comment

Please help us stop spam by answering the question below: