Saturday, March 1

what is Session Replication



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 copy the sessions 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.


There are two types of Session Replication in Weblogic Cluster
1. In-Memory replication
2. DB based Session Replication

Sessions replication can be done using memory which can be access very fast.

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 in weblogic.xml

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


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


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 Replication.

3 comments:

  1. Note:
    When the request is on processing in the middle the server Crashes then what happens?

    if session replication is enabled your session gets replicated to the other nodes in the cluster.There are different type of session replication available in weblogic like in memory based,cookie based,db based. You can set this in your application(Weblogic.xml)

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. how to configur db based replication in weblogic

    ReplyDelete