How many records / rows / nodes is a lot in Firebase?

谁说胖子不能爱 提交于 2019-11-30 06:05:06

问题


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/

If all user applies like 500 postalcodes and the app has about 1000 users it can become a lot of records:

500x1000 = 500000

Will Firebase easily handle that many records in data storage, or should I consider a different approach/solution? What are your thoughts?

Kind regards, Elias


回答1:


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.

A list with 500k rows is hardly useful, so most likely you'll show a subset of the data.

  1. Say you just show the first screenful of nodes. How many nodes will that be? 20? So why would you already retrieve the other nodes already in that case? I'd simply retrieve the nodes needed to build the first screen and load the rest on demand - when/if needed.
  2. Alternatively I could imagine you show a digest of the nodes (like a total number of nodes and maybe some averages per zip code area). You'd need all nodes to determine that digest. But I'd hardly consider it to task of a client application to determine the digest values. That's more something of a server-side task. That server could use the same technology as client-apps (i.e. the JavaScript API), but it wouldn't be bothered (as much) by bandwidth and time constraints.

Just some ideas of how I would approach this, so ymmv.



来源:https://stackoverflow.com/questions/28857905/how-many-records-rows-nodes-is-a-lot-in-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!