【问题标题】:Firestore Snapshot Listener. How many can I listen before affect performanceFirestore 快照侦听器。在影响性能之前我可以听多少
【发布时间】:2019-12-13 08:41:55
【问题描述】:

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

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

【问题讨论】:

标签: android performance firebase google-cloud-firestore


【解决方案1】:

根据Best Practices section of the official Firestore documentation

您应该始终尝试保持每个快照侦听器的数量 100 岁以下的客户。

您还应该记住一些more generic limits and quotas,例如:

每个数据库的移动/网络客户端的最大并发连接数 = 1,000,000

【讨论】:

    猜你喜欢
    • 2021-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-07
    • 1970-01-01
    • 1970-01-01
    • 2021-04-07
    • 2021-03-16
    相关资源
    最近更新 更多