Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Migration

 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, In a distributed web application(that participates in session management), if user-A(who uses session) sends a request, the load blancing server decides to which server the request has to go, say if it is server-A and VM1, then the server-A makes a new session object with unique ID and sends response to the user through cookie.

Next time the user-A makes another request, this time if the load balancing server sends the request to another server say server-B and VM2, then server-B sees the session id and knows this particular session object is present in Server-A and VM1. Then migration happens.
My question is how the server-B knows that this particular session object is present in server-A? Thankyou.
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is Vendor specific the session migration may not present also. J2EE Spec is not telling about this i this.

But in the HF JSP servlet page no256 they telling they have to do the replication on the each node/VM
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Chiranjeevi. Thanks for your reply. Yes, this is vendor specific. Can you please explain,what are the possible solutions, that the vendor may implement? Thankyou.
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are the possible solutions, that the vendor may implement?


No Chinmaya, i dont have that much idea

But in that she is telling that(in High level) the replicate the session to all the nodes.
we can try in the tomcat implementation but i dont know how we will be success in that
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any possible solutions please?
 
Dumitru Postoronca
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store in the database the session id and the associated machine IP ? (this would be slow as hell, but it's one way of doing this).
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dumitru. Thanks for your reply. Even it is slower, I think this is one solution.

If we store session id and ip address of the underlying system in a map object, and store the map object in application context. Is this approach is good? Any possible solutions? Thankyou.
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chimmaya,

I never would have not expected if someone had already posted the question, I have been wondering and about to post!

The way I satisfied whilst going through this topic was load balancing server would maintain a list of session ids mapped to servers. So, whenever a second request comes through, the load balancing server tells server B that this session id already present in server A, then server B makes it to the session to migrate.

I may not be giving right information here but for the exam I have to focus on many more other things than wasting time, so I have got over with these kind of obscure things.

Cheers,
Naren
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Naren. Thaks for your reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic