Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manage session within distributed application

I'm working on distributed web application and we decided to separate web module from business services to make it more scalable.

Here is the situation: We have one server instance that keeps web application (Controllers, JSPs, etc) and lots of server instances with business services. If web application needs any data it asks any of the existing business server via Hessian about it, then got the response and displays data.

Currently we retrieving data from DB based on logged in user and this cannot be changed, so every server should know which user asked to do the job.

My question is: Do you know the solution to keep user session across several independent applications?

For example one of the solutions can be send username with every request but this is not a very good idea for us.

Thanks a lot

like image 340
oyushche Avatar asked Sep 03 '10 15:09

oyushche


Video Answer


1 Answers

There are 2 approaches for this problem:

1) Store all session info in central memcached server

2) Use session-aware load-balancer, which will direct same users to same nodes.

like image 116
BarsMonster Avatar answered Sep 18 '22 16:09

BarsMonster