android - Firestore 快照监听器。在影响性能之前我可以听多少

标签 android performance firebase google-cloud-firestore

我正在开发一个可能有大量用户同时聊天的聊天风格的应用程序。当我进入主屏幕时,我正在检索聊天室列表,然后将 SnapshotListener 添加到每个聊天室以实时收听消息。这可能呈指数级增长,我最终可能会在客户端同时激活数百甚至数千个 SnapshotListener

我的问题是,这会影响性能吗?我的意思是,关于 Firebase 库,当有那么多听众同时处于 Activity 状态时,它有任何类型的限制或性能问题吗?当然不是每个人都会同时聊天,所以即使有 1000 个开放的听众,也只有 5-10 个会同时聊天和发送回叫。

最佳答案

根据Best Practices section of the official Firestore documentation :

You should always try to keep the number of snapshot listeners per client under 100.

你还应该记住一些more generic limits and quotas比如:

The maximum concurrent connections for mobile/web clients per database = 1,000,000

关于android - Firestore 快照监听器。在影响性能之前我可以听多少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59318886/

相关文章:

Flutter找不到Android SDK

mysql - 大量非常简单的sql查询会影响性能吗?

android - 我无法在 firebase 中获得 child 的 key

CSS 性能分析

c# - 是否可以使用属性计算 C# 中方法的执行时间?

android - 如何摆脱自动生成的 ID firebase 数据库?

firebase - Firestore (NoSQL) 是社交媒体应用程序的不错选择吗?

python - 在 Firebase 函数中使用 Google Cloud AutoML 模型预测存储在 Google Cloud 存储中的图像

javascript - 小屏幕 float 内容/额外宽度

java - 将对象添加到 StringBuilder