Facebook and a stateless server
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:
- Use sticky sessions.
- Store session information in in-memory clustered cache. (e.g. solutions using Memcached)
- 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.
精彩评论