Scaling Web Applications

I watched a lecture from a Harvard CS course that provides an excellent overview on scaling web applications.

Key takeaways:

  • Scaling vertically vs. horizontally.
    • Scaling vertically means using a better and better machine as your load increases. The primary downside is that there is a point where you can no longer by a more powerful machine because it's too expensive or simply doesn't exist yet.
  • Always watch out for single point of failures. This is a theme that is emphasized throughout the lecture. The assumption that we should make is that any single piece of machine / technology can and will abruptly stop working. The key is to failing gracefully and have an automated mechanism for transitioning the work to another machine and provisioning another machine to replace the failed machine.
  • Multiple ways of load balancing.
    • Round robin is the simplest method. You simply take turns sending traffic to your various servers.
  • You can scale various layers:
    • Load balancer for the web server
    • Web servers
    • Load balancer for the database
    • Database
  • Managing sticky sessions. Different ways for doing this but the easiest is to tell the load balancer to set a cookie on the client through the HTTP header.
views