最大限度.文档实时侦听器数 [英] Max. number of document realtime listeners

查看:47
本文介绍了最大限度.文档实时侦听器数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用Firestore实时侦听器的最大数量,以及每个侦听器是否有开销?

I'm wondering whether there is a maximum number of Firestore realtime listeners I can use, and if there is an overhead per listener?

这是React Web应用程序中的页面.我想监视集合中所有文档的更改,因此可以选择使用多个文档侦听器或单个集合查询侦听器.典型的文档数量为20-30,但对于极端情况可能会增加到100(我不会设置限制,也不会使用'limit()'.

This is for a page in a React web app. I want to monitor changes in all documents within a collection, so I have the option of either using multiple document listeners, or a single collection query listener. The typical number of documents will be 20-30, but could grow to around 100 for edge cases (I won't be setting a limit, and wouldn't intend on using 'limit()'.

Firestore架构遵循以下原则:

The Firestore architecture is along the lines of:

  /projects/{project}/sections/{section}

示例:用户可以在"project_abc"中编辑部分.

Example: A user can edit sections within "project_abc".

我可以在"sections"集合上设置单个查询侦听器,然后在每次更改时都需要遍历快照(即多个文档),或者将新的文档侦听器附加到每个部分(即可以结束多达30位听众).

I can either setup a single query listener on the 'sections' collection, and then will need to loop through the snapshot (ie multiple docs) on each change, or attach a new document listener to each section (ie. could end up with 30+ listeners).

推荐答案

Cloud Firestore的所有已记录限制已记录在

All of the documented limits of Cloud Firestore are documented here. Most of the limits are placed on writing of data. The only limit that would affect your specific case is the number of (unique client socket) connections capped at 1 million. The listeners themselves are cheap, and you shouldn't be worried about lots of listeners attached to a document.

这篇关于最大限度.文档实时侦听器数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆