Saturday, 15 May 2010

java - Serving user from different servers -



java - Serving user from different servers -

i building catalogue web application (online shopping amazon, ebay) , using mean stack serve data. have product info stored in mongo.

what want that, when user wants purchase product i.e. clicks on purchase button, should redirected server (running mysql , tomcat) rest of procedure. in other words, want handle user orders on java , mysql side. want authenticate user @ point of time i.e. manage sessions.

in scenario, can not share session info across 2 servers. so, question how provide transparency user? don't want user know beingness served different server when placing order.

the primary aim here allow user browse catalogue freely , place order, without letting him know beingness served 2 servers.

you serialize session on mean server, send on tomcat, have deserialized there , parsed active session object. then, redirect session id query parameter (cookies won't work limited read original server) , connect incoming user session object created earlier. have find way circumvent countermeasures there prevent session hijacking, though.

the question is: why want so? architecture breaks @ to the lowest degree 2 basic principles(dry kiss). scheme harder maintain (both development , operations wise), more prone downtime (there - @ to the lowest degree - 4 parts can fail instead of 1 and have leverage security measures on tomcat side create work first place.

assuming have tomcat side ready (by or provided): set it's context path /shop , set rest of app / on tomcat server. removes level of complexity, should easier maintain , deploy.

java session tomcat mean-stack

No comments:

Post a Comment