Regarding the code ... is there any risk that might affect my application from the moment it works in a Load Balancing scenario?
Regarding the code ... is there any risk that might affect my application from the moment it works in a Load Balancing scenario?
Sessions
Sessions are a common problem in systems written for a machine only running in a partitioned environment. The first approaches to ASP.NET were quite flawed, and were fixed with some strategies, such as using a state server .
All user information and navigation information should be on a machine outside the rest of the cluster , this is because keeping the session between the cluster machines caused inconsistency of information.
This article teaches you how to implement a session partitioning scheme for your site . The change on your site is minimal, starting with Web.config
.
Similarly, we can say that load-balanced environments must have a dedicated server to host the files separately from machines that serve a particular ASP.NET MVC system.
The reason is the same as Sessions
: avoid inconsistency. Depending on how the implementation is done, there is a risk that a file will rise to only one of the machines. The strategy of replicating files to other machines may seem tempting, but it can lead to 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 that will ensure the synchronicity of the files, but out of technology and out of standards.