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?
亲切的问候,埃利亚斯
推荐答案
我很确定 Firebase 可以毫无问题地返回 500k 节点.
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.
包含 500k 行的列表几乎没有用,因此您很可能会显示数据的子集.
A list with 500k rows is hardly useful, so most likely you'll show a subset of the data.
- 假设您只显示第一屏节点.那将是多少个节点?20?那么为什么在这种情况下你已经检索了其他节点呢?我只需检索构建第一个屏幕所需的节点,然后按需加载其余节点 - 在需要时/如果需要.
- 或者,我可以想象您显示节点的摘要(例如节点总数和每个邮政编码区域的一些平均值).您需要所有节点来确定该摘要.但我几乎不认为它是客户端应用程序的任务来确定摘要值.这更像是一项服务器端任务.该服务器可以使用与客户端应用程序相同的技术(即 JavaScript API),但不会受到带宽和时间限制的困扰(那么多).
只是我将如何处理这个的一些想法,所以ymmv.
Just some ideas of how I would approach this, so ymmv.
这篇关于Firebase 中有多少记录/行/节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!