Replies: 1 comment 3 replies
-
Thanks for the question, it's a tricky one with no definite answer as it depends on a number of factors. Namely if offline is enabled & if you've fetched the collection before. Firestore sends delta updates that only count as a read when the document has changed. So no, it's not "n" reads, it's only "k" (the number of documents changed since last snapshot). The bytes sent are on the order of "k*m" or less, since it's a delta. Please use a limit though, even if cheap, 50k documents will be stressful on any client. I'd recommend the excellent Get to Know Firestore series on Youtube if you'd like to learn more. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi folks,
I find nothing about this topic in web.
I'm asking myself how expensive onSnapshot really is.
I see
db.collection("myCol").onSnapshot(snapshot => console.log(snapshot.docs));
contains all documents of my collection "myCol". It doesn't contain only the changed data.Since you have just 50k document read accesses in firebase (free) I'm asking myself if a collection with n documents always causes n reads if one document changes and a client is connected with a onSnapshot ?
I've the same question about the network traffic. If I have n documents with each m byte in my collection, would a change in the data (while a active client with onSnapshot) causes n*m bytes traffic?
Maybe somebody could help. If I get no solution for this question I won't use onSnapshot, but I would like to use it ;)
T
Beta Was this translation helpful? Give feedback.
All reactions