locked
Session Maintanance in Application under Web Role RRS feed

  • Question

  • Hi,

    We have planned to migrate our application to web role as web role splits the server traffics to other instances. We have some queries regarding that . Let me post it one by one.

    1) Since web role involves multiple instances (redirecting to different servers at run time based on the number of instances created), what happens to my session related details which was maintained in one server (with inproc mode will get resides in iis ) when my next requests gets redirected to other server where my session related details wont be available know? Do the windows azure takes a copy of that too or do we need to manully handle?

    2)Our application works like Presentation Layer makes a call to the web service which in turn queries the database and results are displayed accordingly (presentation -> webservice -> database). So when am making my presenataion layer as cloud service web role obvioulsy i would need to make my service also as a web role . Am i right?

      2.1) If so, what happens when am making the request from presentation how the requests will get carried ?

      2.2) Am having my database in a separated vm (not azure db) hosted in sql express when the service dynamically 

    creates multiple instances what happens to database part?

      2.3) Shall we host service and presenation in same cloud service or different which will be preferrable one?

    Friday, May 29, 2015 7:12 AM

Answers

  • Hi,

      Sorry for the delayed respose, Hope my replies answers your questions.
     
      1) Since web role involves multiple instances (redirecting to different servers at run time based on the number of instances created), what happens to my session related details which was maintained in one server (with inproc mode will get resides in iis ) when my next requests gets redirected to other server where my session related details wont be available know? Do the windows azure takes a copy of that too or do we need to manully handle?
       Ans: If you are running a Single server, going for InProc session state will just work, if you have multiple servers(instances), managing session state may be a challenge, You will have to design your service to maintain the session state in a central storage. Azure gives you many options to achieve this. Refer to the below link on some of the common options.
       https://azure.microsoft.com/en-in/documentation/articles/cache-dotnet-how-to-use-service/
       http://blogs.msdn.com/b/cie/archive/2013/05/17/session-state-management-in-windows-azure-web-roles.aspx
       https://azure.microsoft.com/en-in/documentation/articles/cache-dotnet-how-to-use-azure-redis-cache/#what-is-azure-redis-cache
       http://wely-lau.net/2011/08/13/various-options-to-manage-session-state-in-windows-azure/
      
      2)Our application works like Presentation Layer makes a call to the web service which in turn queries the database and results are displayed accordingly (presentation -> webservice -> database). So when am making my presenataion layer as cloud service web role obvioulsy i would need to make my service also as a web role . Am i right?
       Ans: Azure Cloud service is perfectly suited for Multi Tier Applications, Normally a webrole is used for the web tier(frontend) and a worker role for the logic (backend), and database or datastorage as the last tier. A Worker role is nothing but a Webrole without the ISS installed. Its upto you to make the decision to use either WebRole or Worker Role to host your service part.
           Refer: http://serena-yeoh.blogspot.in/2014/01/layered-applications-and-windows-azure.html
      
       2.1) If so, what happens when am making the request from presentation how the requests will get carried ?
        Ans: If your roles belong to the same cloud service they can be reached through the internal endpoints. You can get the internal IP address of your roles and the ports and establish communication.
        Refer: https://msdn.microsoft.com/library/azure/hh180158.aspx
       
       2.2) Am having my database in a separated vm (not azure db) hosted in sql express when the service dynamically creates multiple instances what happens to database part?
           Refer This Sample : http://cloudsample.codeplex.com/
       
       2.3) Shall we host service and presenation in same cloud service or different which will be preferrable one?
          Ans: You would ideally want all the roles in the same cloud service, having them in different cloud service means you inter-role communication will be routed through a load balancer which would add latency.
      
    Regards,
    Nithin Rathnakar

    Tuesday, June 2, 2015 5:19 AM

All replies

  • Hi ,

     Any suggestions ?



    • Edited by Selva17392 Friday, May 29, 2015 9:07 AM
    Friday, May 29, 2015 9:07 AM
  • Hi,

    Any Updates?

    Monday, June 1, 2015 5:40 AM
  • Its been 2 days since i didnt get any updates?
    Tuesday, June 2, 2015 4:27 AM
  • Hi,

      Sorry for the delayed respose, Hope my replies answers your questions.
     
      1) Since web role involves multiple instances (redirecting to different servers at run time based on the number of instances created), what happens to my session related details which was maintained in one server (with inproc mode will get resides in iis ) when my next requests gets redirected to other server where my session related details wont be available know? Do the windows azure takes a copy of that too or do we need to manully handle?
       Ans: If you are running a Single server, going for InProc session state will just work, if you have multiple servers(instances), managing session state may be a challenge, You will have to design your service to maintain the session state in a central storage. Azure gives you many options to achieve this. Refer to the below link on some of the common options.
       https://azure.microsoft.com/en-in/documentation/articles/cache-dotnet-how-to-use-service/
       http://blogs.msdn.com/b/cie/archive/2013/05/17/session-state-management-in-windows-azure-web-roles.aspx
       https://azure.microsoft.com/en-in/documentation/articles/cache-dotnet-how-to-use-azure-redis-cache/#what-is-azure-redis-cache
       http://wely-lau.net/2011/08/13/various-options-to-manage-session-state-in-windows-azure/
      
      2)Our application works like Presentation Layer makes a call to the web service which in turn queries the database and results are displayed accordingly (presentation -> webservice -> database). So when am making my presenataion layer as cloud service web role obvioulsy i would need to make my service also as a web role . Am i right?
       Ans: Azure Cloud service is perfectly suited for Multi Tier Applications, Normally a webrole is used for the web tier(frontend) and a worker role for the logic (backend), and database or datastorage as the last tier. A Worker role is nothing but a Webrole without the ISS installed. Its upto you to make the decision to use either WebRole or Worker Role to host your service part.
           Refer: http://serena-yeoh.blogspot.in/2014/01/layered-applications-and-windows-azure.html
      
       2.1) If so, what happens when am making the request from presentation how the requests will get carried ?
        Ans: If your roles belong to the same cloud service they can be reached through the internal endpoints. You can get the internal IP address of your roles and the ports and establish communication.
        Refer: https://msdn.microsoft.com/library/azure/hh180158.aspx
       
       2.2) Am having my database in a separated vm (not azure db) hosted in sql express when the service dynamically creates multiple instances what happens to database part?
           Refer This Sample : http://cloudsample.codeplex.com/
       
       2.3) Shall we host service and presenation in same cloud service or different which will be preferrable one?
          Ans: You would ideally want all the roles in the same cloud service, having them in different cloud service means you inter-role communication will be routed through a load balancer which would add latency.
      
    Regards,
    Nithin Rathnakar

    Tuesday, June 2, 2015 5:19 AM