Facebook 和无状态服务器

发布于 2024-09-05 15:58:52 字数 186 浏览 2 评论 0原文

我正在制作一个 Facebook 应用程序,我想要一个无状态服务器。Facebook 连接请求来自服务器端。因此,当 Facebook 给我一个必须在服务器上维护的会话时,这样我的服务器就不会是无状态的。

当我进行负载平衡时,我不能有一个简单的负载平衡器,而是需要知道哪些用户位于哪个服务器上,这是我不想要的。

有什么想法吗?

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 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

┾廆蒐ゝ 2024-09-12 15:58:52

您可以根据您的应用程序使用情况采用以下任何方法:

  1. 使用粘性会话。
  2. 将会话信息存储在内存中的集群缓存中。 (例如使用 Memcached 的解决方案)
  3. 将会话相关信息保留在数据库中。

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.
嘿看小鸭子会跑 2024-09-12 15:58:52

假设您可以在网页之间传递令牌,一种选择是使用该令牌将状态存储在数据库中。这将使事情独立于网络服务器本身。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文