{"id":144,"date":"2007-10-05T14:07:40","date_gmt":"2007-10-05T18:07:40","guid":{"rendered":"https:\/\/www.thehouse.net\/2007\/10\/05\/client-side-load-balancing-for-web-20\/"},"modified":"2007-10-05T14:07:41","modified_gmt":"2007-10-05T18:07:41","slug":"client-side-load-balancing-for-web-20","status":"publish","type":"post","link":"https:\/\/www.thehouse.net\/?p=144","title":{"rendered":"Client Side Load Balancing for Web 2.0"},"content":{"rendered":"<p>So you&#8217;re writing a large web application, with multiple web servers on the front-end waiting to serve your users. First thing you do is start to think about a Load Balancing solution, be it a hardware solution such as a <a href=\"https:\/\/www.coyotepoint.com\">Coyote Point Systems<\/a> box, or even a &#8216;software&#8217; solution, such as <a href=\"http:\/\/en.wikipedia.org\/wiki\/Round_robin_DNS\">Round Robin DNS<\/a>. Now, with the advent of &#8216;Web 2.0&#8217;, we&#8217;re slowly seeing another &#8216;solution&#8217; starting to gain some traction; Client Side Load Balancing.<\/p>\n<p>To put it simply, we let each &#8216;client&#8217; decide which server to connect to. Each client has a list of all available servers, and randomly selects one and attempts to exchange data. If the client receives a message indicating the server is busy, or no response at all within a set period of time, it moves to another server on the list until it can complete its transaction. <a href=\"http:\/\/www.digital-web.com\/about\/contributors\/lei_zhu\">Lei Zhu<\/a>, a contributor at <a href=\"http:\/\/www.digital-web.com\/\">Digital Web<\/a>, has this to say about the advantages of such a solution:<\/p>\n<blockquote>\n<ol>\n<li> <em>Distribute loads among a cluster of application servers.<\/em>  Since the client randomly selects the server it connects to, the loads should be distributed evenly among the servers. <\/li>\n<li> <em>Handle failover of an application server gracefully.<\/em> The client has the ability to failover to another server when the chosen server does not respond within a preset period of time. The application server connection seamlessly fails over to another server. <\/li>\n<li> <em>Ensure the cluster of servers appears to the end user as a single server.<\/em> In the example, the user simply points a browser to http:\/\/www.myloadbalancedwebsite.com\/. The actual server used is transparent to the user. <\/li>\n<\/ol>\n<\/blockquote>\n<p>A big advantage to such a solution is that you don&#8217;t need to spend money on a hardware device, at least in the short-term. You can have some code on your back-end that monitors the web servers and removes any unavailable servers from the server list sent to each client.<\/p>\n<p>Another advantage that Lei points out is that the web servers can be distributed anywhere geographically. Sure, this can be done with a load balancer, but it&#8217;s a far trickier and complicated setup then just having to change a server entry in a file sent to each client. <\/p>\n<p>Lei&#8217;s article also includes a short write-up of an application, <a href=\"http:\/\/www.voxlite.com\/\">Voxlite<\/a>, using such a design. <\/p>\n<p>Overall, while I still have some doubts regarding the scalability of such a solution, it&#8217;s an interesting use of Web 2.0.<\/p>\n<p><a href=\"http:\/\/www.digital-web.com\/articles\/client_side_load_balancing\/\">Digital Web Magazine &#8211; Client Side Load Balancing for Web 2.0 Applications<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So you&#8217;re writing a large web application, with multiple web servers on the front-end waiting to serve your users. First thing you do is start to think about a Load Balancing solution, be it a hardware solution such as a Coyote Point Systems box, or even a &#8216;software&#8217; solution, such as Round Robin DNS. Now, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[19,7],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-ajaxweb-20","category-geek-stuff"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pA6RZ-2k","_links":{"self":[{"href":"https:\/\/www.thehouse.net\/index.php?rest_route=\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thehouse.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thehouse.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thehouse.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thehouse.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=144"}],"version-history":[{"count":0,"href":"https:\/\/www.thehouse.net\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.thehouse.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thehouse.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thehouse.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}