web-farmweb-architecture

Web application architecture in a web farm


I know there are a some changes to a web application when moving from a single web server to two, or more, web servers. But architectually, are there any other changes to consider when adding more servers to the farm? I understand deployment would become more complex with more servers in the farm. I ask because a while ago during an interview, there was concern that I didn't have enough experience dealing with a large web farm. Three servers is about the biggest I've worked with.


Solution

  • One important thing to take care about is using memory-based storage. This includes session state, application state, cache, etc. When you have a single server it's safe to use these to write values for later use and expect to find them there later. In a web farm each application instance will have it's own memory space so you need to take care when using it between different page requests.

    The session state can be changed to be SQL-server based or to use a state server, this will alleviate some of the problems, allow you to properly handle user sessions (if the application has the concept of users and accounts). Having session stickyness is another good thing in order to make sure that once a user was directed to a certain machine in the farm it will continue to be directed to the same machine throughout the visit.

    Of course there are other aspects to address, but this is one thing I just happen to deal with right now.