如何处理 Facebook Graph 的大量查询?

发布于 2024-12-07 16:17:08 字数 154 浏览 1 评论 0原文

我想了解每个朋友的每一个状态更新。假设我有 500 个朋友,每个朋友有 200 个状态,那么这可能是 100,000 个状态。从查询的角度来看,您将如何处理这个问题?

你会写什么查询? Facebook 会允许一次性传输这么多数据吗?如果没有,是否有最佳实践分页或偏移解决方案?

I'd like to get every status update for every friend. Given I have say 500 friends, each with 200 statuses, this could be 100,000 statuses. How would you approach this from the query point of view?

What query would you write? Would Facebook allow this much data to come through in a single go? If not is there a best practice paging or offsetting solution?

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

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

发布评论

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

评论(2

緦唸λ蓇 2024-12-14 16:17:08

Facebook 会允许一次性传输这么多数据吗?

不会。Facebook 会抛出数据过多异常。此外,还有一个自动化系统,它会阻止耗时的请求,并且如果您的应用程序在单个表上过于频繁地进行过多查询,它也会阻止您的应用程序 - API 限制警告。

如果没有,是否有最佳实践分页或偏移解决方案?

您可以在 FQL 中以及在图形中查询连接时进行分页。这是最佳实践。

Would Facebook allow this much data to come through in a single go?

No. Facebook will throw exception of too much data. Also there is automated system in place which will block time-consuming requests as well as it will block your app if it is making too much queries too frequently on a single table - API Throttling Warnings.

If not is there a best practice paging or offsetting solution?

You can do paging in FQL and when querying connections in graph. It is best practice.

-小熊_ 2024-12-14 16:17:08

从他们的政策来看:

如果您超过或计划超过以下任何阈值,请联系我们,因为您可能需要遵守附加条款:(>5M MAU) 或 (>100M API 调用每天) 或 (>50M每天的展示次数)。

http://developers.facebook.com/policy/

这意味着 100k 并不是什么大不了的事。不过,这取决于情况。您可能必须考虑,

  • 您真的需要每种身份吗?
  • 以后就不能下载了吗?
  • 您需要每个朋友的这些帖子/故事吗?

From their policy:

If you exceed, or plan to exceed, any of the following thresholds please contact us as you may be subject to additional terms: (>5M MAU) or (>100M API calls per day) or (>50M impressions per day).

http://developers.facebook.com/policy/

It means that 100k is not so big deal. However, it depends. You may have to consider,

  • Do you REALLY need every status?
  • Can't they be downloaded later?
  • Do you need these posts/stories from every friend?
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文