是什么是firebase数据库连接?

发布于 2025-02-07 11:51:12 字数 248 浏览 1 评论 0原文

我正在研究iOS的功能,我们想查询firebase实时数据库,该数据库仅更新一次。我看到有200k同时连接的限制(对于大火计划)。我的问题是:什么是主动连接?

例如,如果我们使用.observe()方法创建一个观察结果,那么这是否意味着1连接,只要我们要观察? 以及使用.getData()的“一击”提取呢?完成后是否关闭连接?

实际上,我们对长期观察的活力并不感兴趣,因为数据仅每周只会变化一次。

I'm working on a feature on iOS for which we want to query a Firebase realtime database, which only updates about once a week. I saw there is a limit of 200k simultaneous connections (for the Blaze plan). My question is: what counts as an active connection?

For example, if we create an observation using the .observe() method, does that mean 1 connection as long as we are observing?
And what about a 'one shot' fetch, using .getData(). Does this close the connection after completion?

We're not actually interested in keeping an observation alive for a long time, as data only changes about once a week.

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

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

发布评论

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

评论(1

青朷 2025-02-14 11:51:13

经常询问的问题

同时连接等于连接到数据库的一个移动设备,浏览器选项卡或服务器应用程序。 Firebase对与应用程序数据库的同时连接的数量施加了严格的限制。这些限制已适当,以保护火箱和我们的用户免受滥用。

SDK首次尝试从(或将数据写入)访问数据库的数据时连接到服务器。只要客户有一个主动的侦听器(在您的情况下, )或直到上次读取或写入操作后约5分钟,该连接就保持打开状态。

您还可以通过调用 <代码> gooffline 和goonline 在您的代码中。

From the frequently asked questions:

A simultaneous connection is equivalent to one mobile device, browser tab, or server app connected to the database. Firebase imposes hard limits on the number of simultaneous connections to your app's database. These limits are in place to protect both Firebase and our users from abuse.

The SDK connects to the server the first time that you try to access data from (or write data to) the database. The connection stays open for as long as the client has an active listener (so observe in your case) or until about 5 minutes after the last read or write operation.

You can also explicitly control the connection by calling goOffline and goOnline in your code.

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