Firebase中有多少条记录/行/节点? [英] How many records / rows / nodes is a lot in Firebase?
问题描述
我正在创建一个应用程序,它将用户存储在要传递给他们的所有邮政编码/邮政编码下。结构如下:
I'm creating an app where I will store users under all postalcodes/zipcodes they want to deliver to. The structure looks like this:
postalcodes/{{postalcode}}/{{userId}}=true
该结构的原因是可以轻松获取所有使用特定邮政编码的用户。
The reason for the structure is to easily fetch all users who deliver to a certain postal code.
ex. postalcodes/21121/
如果所有用户都使用500个邮政编码,而该应用程序大约有1000个用户,则可以很多记录:
If all user applies like 500 postalcodes and the app has about 1000 users it can become a lot of records:
500x1000 = 500000
Firebase是否可以轻松处理数据存储中的那么多记录,还是我应该考虑采用其他方法/解决方案?您的想法是什么?
Will Firebase easily handle that many records in data storage, or should I consider a different approach/solution? What are your thoughts?
亲切的问候,
Elias
Kind regards, Elias
推荐答案
我非常确定Firebase可以毫无问题地返回50万个节点。
I'm quite sure Firebase can return 500k nodes without a problem.
更大的问题是检索将花费多长时间(尤其是在此移动优先时代)以及您的应用程序将基于那么多节点向用户显示什么。
The bigger concerns are how long that retrieval will take (especially in this mobile-first era) and what your application will show your user based on that many nodes.
包含50万行的列表几乎没有用,因此很可能会显示一部分数据。
A list with 500k rows is hardly useful, so most likely you'll show a subset of the data.
- 假设您只显示第一个屏幕节点。那将是多少个节点? 20吗那么,在这种情况下,为什么还要已经检索其他节点呢?我只是简单地检索构建第一个屏幕所需的节点,并在需要时/需要时加载其余屏幕。
- 或者,我可以想象您显示了这些节点的摘要(例如节点总数,可能还有每个邮政编码区域的一些平均值)。您需要所有节点来确定该摘要。但是,我几乎不会考虑将其用于客户端应用程序来确定摘要值。这更多的是服务器端任务。该服务器可以使用与客户端应用程序相同的技术(即JavaScript API),但是不会受到带宽和时间限制的困扰。
只是一些关于如何处理此问题的想法,好吧。
Just some ideas of how I would approach this, so ymmv.
这篇关于Firebase中有多少条记录/行/节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!