How to maintain ViewState in web-farm environment?

Discussion in 'ASP .Net Mobile' started by Dominic, Nov 18, 2004.

  1. Dominic

    Dominic Guest

    My question is about how to maintain view state in mobile ASP.NET
    across postback / request in a web farm environment.

    First of all, let's assume the web-farm does NOT use stick-session
    feature. In other words, different web servers may serve different
    requests in the SAME session.

    In non-mobile ASP.NET, my understanding is that the view state
    information is passed between each client browser and server with
    every post-back. Even if the request is handled by another different
    web server in the web farm, the viewstate information is still
    available in the postback because it is stored in the request (not the
    web server). Therefore, maintaining viewstate information is not an
    issue in a web farm environment.

    However, in mobile ASP.NET, view state is stored in session object
    (ref: Building Microsoft ASP.NET Applications for Mobile Devices by
    Andy Wigley and Peter Roxburgh - p. 386). In order to maintain view
    state, is it true that the ONLY option is to store the session
    information in a separate web server or database server (setting
    <sessionState mode="StateServer" or "SqlServer"> in web.config)?
    Without doing that, how can we maintain the viewstate across postback
    in a non-sticky-session web-farm environment?

    I don't quite like the idea of storing session information in separate
    web server or database server. It is because one important reason of
    running a web-farm is to increase availability. If the web-server / DB
    server storing the session information fails, the whole web-farm will
    fail to run properly. Right?

    Any insight is much appreciated! Thanks!

    Dom
    Dominic, Nov 18, 2004
    #1
    1. Advertising

  2. Dominic

    clintonG Guest

    SQL Server
    Google: "maintain state"+"web farm"+"asp.net"


    --
    <%= Clinton Gallagher, "Twice the Results -- Half the Cost"
    Architectural & e-Business Consulting -- Software Development
    NET
    URL http://www.metromilwaukee.com/clintongallagher/

    "Dominic" <> wrote in message
    news:...
    > My question is about how to maintain view state in mobile ASP.NET
    > across postback / request in a web farm environment.
    >
    > First of all, let's assume the web-farm does NOT use stick-session
    > feature. In other words, different web servers may serve different
    > requests in the SAME session.
    >
    > In non-mobile ASP.NET, my understanding is that the view state
    > information is passed between each client browser and server with
    > every post-back. Even if the request is handled by another different
    > web server in the web farm, the viewstate information is still
    > available in the postback because it is stored in the request (not the
    > web server). Therefore, maintaining viewstate information is not an
    > issue in a web farm environment.
    >
    > However, in mobile ASP.NET, view state is stored in session object
    > (ref: Building Microsoft ASP.NET Applications for Mobile Devices by
    > Andy Wigley and Peter Roxburgh - p. 386). In order to maintain view
    > state, is it true that the ONLY option is to store the session
    > information in a separate web server or database server (setting
    > <sessionState mode="StateServer" or "SqlServer"> in web.config)?
    > Without doing that, how can we maintain the viewstate across postback
    > in a non-sticky-session web-farm environment?
    >
    > I don't quite like the idea of storing session information in separate
    > web server or database server. It is because one important reason of
    > running a web-farm is to increase availability. If the web-server / DB
    > server storing the session information fails, the whole web-farm will
    > fail to run properly. Right?
    >
    > Any insight is much appreciated! Thanks!
    >
    > Dom
    clintonG, Nov 18, 2004
    #2
    1. Advertising

  3. > I don't quite like the idea of storing session information in separate
    > web server or database server. It is because one important reason of
    > running a web-farm is to increase availability. If the web-server / DB
    > server storing the session information fails, the whole web-farm will
    > fail to run properly. Right?


    It is always good to be aware of, and account for, points of failure. As
    this seems to be the only issue which troubles you, let me remind you that
    SQL Servers can be mirrored, and that you can set up a Fail-Over SQL Server
    in case the problem you described occurs.

    If, on the other hand, you're trying to make sure that there are absolutely
    NO points of failure, I would suggest using an abacus. ;-)

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Neither a follower
    nor a lender be.

    "Dominic" <> wrote in message
    news:...
    > My question is about how to maintain view state in mobile ASP.NET
    > across postback / request in a web farm environment.
    >
    > First of all, let's assume the web-farm does NOT use stick-session
    > feature. In other words, different web servers may serve different
    > requests in the SAME session.
    >
    > In non-mobile ASP.NET, my understanding is that the view state
    > information is passed between each client browser and server with
    > every post-back. Even if the request is handled by another different
    > web server in the web farm, the viewstate information is still
    > available in the postback because it is stored in the request (not the
    > web server). Therefore, maintaining viewstate information is not an
    > issue in a web farm environment.
    >
    > However, in mobile ASP.NET, view state is stored in session object
    > (ref: Building Microsoft ASP.NET Applications for Mobile Devices by
    > Andy Wigley and Peter Roxburgh - p. 386). In order to maintain view
    > state, is it true that the ONLY option is to store the session
    > information in a separate web server or database server (setting
    > <sessionState mode="StateServer" or "SqlServer"> in web.config)?
    > Without doing that, how can we maintain the viewstate across postback
    > in a non-sticky-session web-farm environment?
    >
    > I don't quite like the idea of storing session information in separate
    > web server or database server. It is because one important reason of
    > running a web-farm is to increase availability. If the web-server / DB
    > server storing the session information fails, the whole web-farm will
    > fail to run properly. Right?
    >
    > Any insight is much appreciated! Thanks!
    >
    > Dom
    Kevin Spencer, Nov 18, 2004
    #3
  4. Dominic

    clintonG Guest

    What if his fingers get greasy after lunch?

    --
    <%= Clinton Gallagher, "Twice the Results -- Half the Cost"
    Architectural & e-Business Consulting -- Software Development
    NET
    URL http://www.metromilwaukee.com/clintongallagher/


    "Kevin Spencer" <> wrote in message
    news:%...
    > > I don't quite like the idea of storing session information in separate
    > > web server or database server. It is because one important reason of
    > > running a web-farm is to increase availability. If the web-server / DB
    > > server storing the session information fails, the whole web-farm will
    > > fail to run properly. Right?

    >
    > It is always good to be aware of, and account for, points of failure. As
    > this seems to be the only issue which troubles you, let me remind you that
    > SQL Servers can be mirrored, and that you can set up a Fail-Over SQL

    Server
    > in case the problem you described occurs.
    >
    > If, on the other hand, you're trying to make sure that there are

    absolutely
    > NO points of failure, I would suggest using an abacus. ;-)
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Neither a follower
    > nor a lender be.
    >
    > "Dominic" <> wrote in message
    > news:...
    > > My question is about how to maintain view state in mobile ASP.NET
    > > across postback / request in a web farm environment.
    > >
    > > First of all, let's assume the web-farm does NOT use stick-session
    > > feature. In other words, different web servers may serve different
    > > requests in the SAME session.
    > >
    > > In non-mobile ASP.NET, my understanding is that the view state
    > > information is passed between each client browser and server with
    > > every post-back. Even if the request is handled by another different
    > > web server in the web farm, the viewstate information is still
    > > available in the postback because it is stored in the request (not the
    > > web server). Therefore, maintaining viewstate information is not an
    > > issue in a web farm environment.
    > >
    > > However, in mobile ASP.NET, view state is stored in session object
    > > (ref: Building Microsoft ASP.NET Applications for Mobile Devices by
    > > Andy Wigley and Peter Roxburgh - p. 386). In order to maintain view
    > > state, is it true that the ONLY option is to store the session
    > > information in a separate web server or database server (setting
    > > <sessionState mode="StateServer" or "SqlServer"> in web.config)?
    > > Without doing that, how can we maintain the viewstate across postback
    > > in a non-sticky-session web-farm environment?
    > >
    > > I don't quite like the idea of storing session information in separate
    > > web server or database server. It is because one important reason of
    > > running a web-farm is to increase availability. If the web-server / DB
    > > server storing the session information fails, the whole web-farm will
    > > fail to run properly. Right?
    > >
    > > Any insight is much appreciated! Thanks!
    > >
    > > Dom

    >
    >
    clintonG, Nov 18, 2004
    #4
  5. Dominic

    Dominic Guest

    Kevin, thanks for your reply.

    Let me put my question in another way.

    Let's assume the following:
    - I don't want to set up SQL server to store session (say, for the
    sake of performance) and so I use "Inproc" mode for session state,
    - The load-balancer DOES support sticky-session, and
    - I don't want to use abacus

    Can I conclude that the session and viewstate information can be
    safely maintained in the web server in this web farm environment for
    mobile ASP.NET?

    Dom



    "Kevin Spencer" <> wrote in message news:<#>...
    > > I don't quite like the idea of storing session information in separate
    > > web server or database server. It is because one important reason of
    > > running a web-farm is to increase availability. If the web-server / DB
    > > server storing the session information fails, the whole web-farm will
    > > fail to run properly. Right?

    >
    > It is always good to be aware of, and account for, points of failure. As
    > this seems to be the only issue which troubles you, let me remind you that
    > SQL Servers can be mirrored, and that you can set up a Fail-Over SQL Server
    > in case the problem you described occurs.
    >
    > If, on the other hand, you're trying to make sure that there are absolutely
    > NO points of failure, I would suggest using an abacus. ;-)
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Neither a follower
    > nor a lender be.
    >
    > "Dominic" <> wrote in message
    > news:...
    > > My question is about how to maintain view state in mobile ASP.NET
    > > across postback / request in a web farm environment.
    > >
    > > First of all, let's assume the web-farm does NOT use stick-session
    > > feature. In other words, different web servers may serve different
    > > requests in the SAME session.
    > >
    > > In non-mobile ASP.NET, my understanding is that the view state
    > > information is passed between each client browser and server with
    > > every post-back. Even if the request is handled by another different
    > > web server in the web farm, the viewstate information is still
    > > available in the postback because it is stored in the request (not the
    > > web server). Therefore, maintaining viewstate information is not an
    > > issue in a web farm environment.
    > >
    > > However, in mobile ASP.NET, view state is stored in session object
    > > (ref: Building Microsoft ASP.NET Applications for Mobile Devices by
    > > Andy Wigley and Peter Roxburgh - p. 386). In order to maintain view
    > > state, is it true that the ONLY option is to store the session
    > > information in a separate web server or database server (setting
    > > <sessionState mode="StateServer" or "SqlServer"> in web.config)?
    > > Without doing that, how can we maintain the viewstate across postback
    > > in a non-sticky-session web-farm environment?
    > >
    > > I don't quite like the idea of storing session information in separate
    > > web server or database server. It is because one important reason of
    > > running a web-farm is to increase availability. If the web-server / DB
    > > server storing the session information fails, the whole web-farm will
    > > fail to run properly. Right?
    > >
    > > Any insight is much appreciated! Thanks!
    > >
    > > Dom
    Dominic, Nov 19, 2004
    #5
  6. Dominic

    John M Deal Guest

    Be aware that you will still have session problems with InProc if the
    servers in your farm are multi-processor machines running IIS6 with web
    gardens enabled. This is because each processor will be given its own
    worker process and each worker process will have its own session and
    application objects in memory. Application isn't a problem bu session
    will be if you don't at minimum configure StateServer on the same
    machine for the two worker processes to talk to. This may not be an
    issue for you (if you are not using IIS6 or web gardens) but it is worth
    mentioning when someone is looking for possible issue.

    Have A Better One!

    John M Deal, MCP
    Necessity Software

    P.S. I just noticed the mention of the "mobile" qualification and have
    no idea how that impacts my statements above as I've never tried the
    scenario with a mobile device but I still think it is worth mentioning
    "just-in-case."

    Dominic wrote:
    > Kevin, thanks for your reply.
    >
    > Let me put my question in another way.
    >
    > Let's assume the following:
    > - I don't want to set up SQL server to store session (say, for the
    > sake of performance) and so I use "Inproc" mode for session state,
    > - The load-balancer DOES support sticky-session, and
    > - I don't want to use abacus
    >
    > Can I conclude that the session and viewstate information can be
    > safely maintained in the web server in this web farm environment for
    > mobile ASP.NET?
    >
    > Dom
    >
    >
    >
    > "Kevin Spencer" <> wrote in message news:<#>...
    >
    >>>I don't quite like the idea of storing session information in separate
    >>>web server or database server. It is because one important reason of
    >>>running a web-farm is to increase availability. If the web-server / DB
    >>>server storing the session information fails, the whole web-farm will
    >>>fail to run properly. Right?

    >>
    >>It is always good to be aware of, and account for, points of failure. As
    >>this seems to be the only issue which troubles you, let me remind you that
    >>SQL Servers can be mirrored, and that you can set up a Fail-Over SQL Server
    >>in case the problem you described occurs.
    >>
    >>If, on the other hand, you're trying to make sure that there are absolutely
    >>NO points of failure, I would suggest using an abacus. ;-)
    >>
    >>--
    >>HTH,
    >>Kevin Spencer
    >>.Net Developer
    >>Microsoft MVP
    >>Neither a follower
    >>nor a lender be.
    >>
    >>"Dominic" <> wrote in message
    >>news:...
    >>
    >>>My question is about how to maintain view state in mobile ASP.NET
    >>>across postback / request in a web farm environment.
    >>>
    >>>First of all, let's assume the web-farm does NOT use stick-session
    >>>feature. In other words, different web servers may serve different
    >>>requests in the SAME session.
    >>>
    >>>In non-mobile ASP.NET, my understanding is that the view state
    >>>information is passed between each client browser and server with
    >>>every post-back. Even if the request is handled by another different
    >>>web server in the web farm, the viewstate information is still
    >>>available in the postback because it is stored in the request (not the
    >>>web server). Therefore, maintaining viewstate information is not an
    >>>issue in a web farm environment.
    >>>
    >>>However, in mobile ASP.NET, view state is stored in session object
    >>>(ref: Building Microsoft ASP.NET Applications for Mobile Devices by
    >>>Andy Wigley and Peter Roxburgh - p. 386). In order to maintain view
    >>>state, is it true that the ONLY option is to store the session
    >>>information in a separate web server or database server (setting
    >>><sessionState mode="StateServer" or "SqlServer"> in web.config)?
    >>>Without doing that, how can we maintain the viewstate across postback
    >>>in a non-sticky-session web-farm environment?
    >>>
    >>>I don't quite like the idea of storing session information in separate
    >>>web server or database server. It is because one important reason of
    >>>running a web-farm is to increase availability. If the web-server / DB
    >>>server storing the session information fails, the whole web-farm will
    >>>fail to run properly. Right?
    >>>
    >>>Any insight is much appreciated! Thanks!
    >>>
    >>>Dom
    John M Deal, Nov 19, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S S Venkatesh

    Viewstate problems in web farm

    S S Venkatesh, Oct 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    469
    Karl Seguin
    Oct 7, 2004
  2. Dominic
    Replies:
    5
    Views:
    4,723
    John M Deal
    Nov 19, 2004
  3. =?Utf-8?B?TWFnZGVsaW4=?=

    ViewState Corrupted in Web Farm

    =?Utf-8?B?TWFnZGVsaW4=?=, Dec 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,372
    =?Utf-8?B?TWFnZGVsaW4=?=
    Dec 6, 2004
  4. Replies:
    0
    Views:
    415
  5. Dhruba Bandopadhyay
    Replies:
    1
    Views:
    21,615
    Alvin Bruney
    May 25, 2006
Loading...

Share This Page