I am using an application variables to store the values and again access it.but my Question here as we using multiple servers (web farms). will be there any issue whiling access the values or it not worth to store values in application state variables when we are going ahead with multiple server
Thanks prince
"Application state" = the state of the application, which is the same for all users. "Session State" = state specific to this particular user session. Each user has separate session state.
Application variables are values that are available to any user or page within an application. For the first time, they can be any value you wish to store.
So, we can say that there are mainly two different ways to manage a web application's state: client-side and server-side.
SessionState: It can be used to store information that you wish to access on different web pages. ViewState It can be used to store information that you wish to access from same web page.
No, Application State is not shared across the servers in a web farm, as per the documentation (see the section entitled Scalability).
Application state is not shared among multiple servers serving the same application, as in a Web farm, or among multiple worker processes serving the same application on the same server, as in a Web garden. Your application therefore cannot rely on application state containing the same data for application state across different servers or processes.
You will need to find some other store for this shared information, i.e. via a database or shared cache.
However, you will be able to share viewstate and forms authenticate tickets across all servers in the web farm, but you must set the <machineKey>
to the same values on all servers.
From the first article below:
If you deploy your application in a Web farm, you must ensure that the configuration files on each server share the same value for validationKey and decryptionKey, which are used for hashing and decryption respectively. This is required because you cannot guarantee which server will handle successive requests.
These MSDN articles have more information:
http://msdn.microsoft.com/en-us/library/ff649308.aspx#paght000007_webfarmdeploymentconsiderations
http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With