Thursday, April 17

Session Replication

1. Session Replication is nothing but having the user sessions on two location for high availability

So when the session gets created on one server which is called primary then it will get copied to other server which is called secondary,the cookie will have the details about both the primary and secondary session server details,if something happens to primary server then the user requests will be forwarded to secondary server which will become primary and it will copy the session some new secondary server in the cluster.

Sessions replication can be done using memory,file system and database, most of the app uses memory which can be access very fastl.

If you want to see whether session replication enabled and which replication is being used by the app,u need to check the weblogic.xml file of the application.

for example if you see the below line

'<'replicate-if-clustered'>'true'<'replicate-if-clustered'>'
 - this means in-memory replication is enabled if the application is deployed on a cluster.



  • Vinod Kumar In-Memory Replication:
    Here more than one Managed server in a cluster of Domain keep the http session details of a particular browser connection.


    Primary server process the request and choose other server (randomly or based upon settings) to keep the backup of http session details
    ( Replication).

    So, the secondary server will only keep the backup, not process the request. The info of (Replication) will be sent back to browser (cookies). In case, the primary server goes down, the LB ( Load balancer) will direct the secondary server ,based upon cookies to process the request from the point where primary server stopped. It is called In-Memory Replication.


  • Vinod Kumar DB-based Replication:
    Instead of storing http session backup in other managed server , it can be stored in DB. Now, Load Balancer can direct any available server to continue the request, if primary server goes down.
    It is called DB based Replica
    tion.
    It is gives better availability as it will work even if secondary server goes down , as any server can process the request. But it is much slower than In-Memory replication.

No comments:

Post a Comment