Thursday, March 6

What is session replication?


Weblogic Server provides clustering support for servlets and JSPs by replicating 'HTTP session state' of clients that access servlets and JSPs through a cluster service. Weblogic Server can use 'memory, file based and database' persistence for storing session information.

==========================================================================

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.

No comments:

Post a Comment