What are the risks of putting an ASP.NET application in an environment with Load Balancing?

Asked

Viewed 125 times

6

Regarding the code... there is some risk that may affect my application from the moment it works in a Load Balancing scenario?

1 answer

8


1. Sessions

Sessions are a common problem in systems written for a single machine that are run in a partitioned environment. The first approaches to ASP.NET were quite flawed, and were corrected with some strategies, such as the use of a state server.

All user information and navigation information must be on a machine outside the rest of the cluster, this because keep session between the machines of the cluster caused inconsistency of information.

This article teaches you how to implement a session partitioning scheme for your website. The change on your site is minimal, starting from the Web.config.

2. Dealing with files

Similarly, we can say that load-balancing environments need to have a server dedicated to hosting the files separately from the machines serving a particular ASP.NET MVC system.

The reason is the same as Sessions: avoid inconsistency. Depending on how the implementation is done, there is the risk of a file going up to just one of the machines. The strategy of replicating the files to other machines may seem tempting, but it can generate even more inconsistencies because, in theory, there is no mechanism to ensure file synchronization within ASP.NET MVC. Of course, there may still be alternatives to ensure file synchronization, but out of technology and out of the box.

  • Just have trouble with the sessions anyway? No problem for example... I save a file and it stay only on one of the machines, something like?

  • @psNytrancez This is easier to solve. It would be the case to map the file directory also to a machine separate from the applications. If you want I can increase the answer with this.

  • I think it would be interesting to add that to the answer since the idea is to map out all the risks.

  • @psNytrancez See if you’re okay, please.

  • @Ciganomorrisonmendez beyond ASP.net MVC believe this to be true in any other server-side language.

  • @gmsantos Truth. I tried to focus my answer to the technology mentioned in the question. I do not know how it looks the balance of Sessions in other technologies.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.