Firebase database requests and queries like SQL WHERE IN [duplicate]

a 夏天 提交于 2020-01-07 08:35:47

问题


I am new to firebase and I have a couple of questions.. I found some information in old posts but unfortunately are too old to consider them as valid (dated back to 2013).

Number of requests per client:

I am not even sure what I am asking.. I read somewhere that Firebase allows 10 requests per second per client. I cannot find this information anymore and in the firebase website is not mentioned in any way.. Is there such a thing as "requests limit"?

If we assume that this limitation exists and the number of allowed requests is 10.. then what is considered as a request?

Is it a request only when I connect to the database for the first time I open my application? Is it every single select query I perform? Does having listeners spend requests?

I found myself a case where I need to run a query which in SQL would be like: Select * from table where id IN (id1,id2,id7, id200, id143 )

Can I do that in Firebase?

Or I have to do 5 different select queries? If the latter is the case, then are they considered as 5 different requests?

One good example describing this problem was mentioned in an other stackoverflow post where the application fetches the facebook list of the user and needs to check which of these friends are already members to the firebase application based on the facebook ids(old question of 2013.. suggested links pointed to the old firebase site which does not work anymore..).

How a problem like that should be approached?

Thank you very much in advance.


回答1:


No, firebase does not have a request limit and neither a IN or OR SQL-like operator. And thats the reason why you don't have to be concerned on doing one request for each value you are querying.

Make sure you are triggering this queries asynchronously in your application and you will be fine. Firebase was built to handle as much simultaneous request as needed.

You can find firebase free-plan limitations in the pricing session.



来源:https://stackoverflow.com/questions/39058119/firebase-database-requests-and-queries-like-sql-where-in

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