How Firestore billing works in case of exact same query from different sources?

故事扮演 提交于 2020-08-10 19:16:49

问题


Confusion with Firestore billing never ends!

Lets say I have an Android app with bottom navigation, in which, one of the menus is displying some documents from a collection using a real-time listener. Now, it is very common for user to jump from one nav-menu to other in a short period of time. This is handled by replacing fragments, resulting in creation of new Query object on each onStart. Similar situation may happen in case of Activities.

This answer says that for every new Query object, we are charged, regardless of what the query is. Whereas, my understanding was, Firestore is smart enough to keep record of the queries itself. Meaning that, no matter which object fired the query, if Firestore has served exactly the same query within the 30 min duration, it will not charge (or will charge only for the delta of changes).

If I am wrong and Firestore does charge on the basis of objects, then 30 min duration is useless. No user is going to stay on the same page/activity/fragment for that long.

Need more clarity on how Firestore handles such situations internally and how it bills?

来源:https://stackoverflow.com/questions/63033423/how-firestore-billing-works-in-case-of-exact-same-query-from-different-sources

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