开发者

Facebook and a stateless server

开发者 https://www.devze.com 2023-01-03 23:29 出处:网络
I am making a Facebook application, I want to have a stateless server.The Facebook connect requests are from the server side. So when Facebook gives开发者_C百科 me a session which has to be maintained

I am making a Facebook application, I want to have a stateless server.The Facebook connect requests are from the server side. So when Facebook gives开发者_C百科 me a session which has to be maintained at the server this way my server won't be stateless.

When I'll load balance I can't have a simple load balancer instead it would need to know which users are on which server, something I don't want.

Any Ideas?


You can go with any of the following approaches depending upon your application usage:

  1. Use sticky sessions.
  2. Store session information in in-memory clustered cache. (e.g. solutions using Memcached)
  3. Persist session related information in Database.


Assuming you can pass a token between web pages, one option is to store the state in a database using that token. That'll keep things independent of the webserver itself.

0

精彩评论

暂无评论...
验证码 换一张
取 消