Load balancer explanation

Solution 1:

That picture is a good first approximation of loadbalancing and for most sites it'll be more than enough. Sites like google, youtube and facebook can and do use a few more tricks, here's a few I've used so far or am planning to do for another large e-commerce site:

  • Use DNS to spread requests to multiple loadbalancers, even multiple datacenters
  • Use a combination of DNS and anycast IP ranges/CDn's to attract local traffic geographically
  • Have the outermost loadbalancer do only layer 4 balancing to more loadbalancers, and have these do all necesarry layer seven processing

These layer 7 tricks can include:

  • Tying a user to a server via a cookie or url
  • Locating content and redirecting appropriately
  • Analytics for further performance improvement
  • Abuse detection & prevention at layer 7