we have our old website built on LAMP stack with user authentication. Now we have built a new social platform for the same users with live chat features, video and discussion forums etc and we have used node.js for this purpose.
When a user is logged in his account in the old site - lets say he can click on a link
www.xyz.com/social
which will take him to this new node.js platform.
So I'm not sure on how to pass user details from apache to node.js - All I will need is user id and then in node.js - I can query the mysql table and load the user details.
Simple Solution
The simple solution is to hash the user id and email and store the hash as key in memcache server and pass user details as values
$hash = md5($user_id+$email);
$memcache = new Memcache;
$memcache->connect("localhost",11211) or die ("could not connect");
$data = json_encode(array("id"=>$user_id,"name"=>"aaa"));
$memcache->set("key-".$hash,$data);
And then in the link pass the hash value as parameter like
www.xyz.com/social/$$hash-value$$
and in node js - retrieve the user details from memcache based on the hash key.
1) Is this the right away to approach this.
2) Will memcache support storing data of so many users (around 500 users at a given time) moving within the website from the old site to the new node.js site.
Thanks in advance for your inputs.