0

I'd like some clarification on how firestore behaves via web.

reading this answer, Speed up fetching posts for my social network app by using query instead of observing a single event repeatedly

It is made very clear that on android all requests are done via a single persistent connection.

For my web app however, I'm using the javascript SDK and if i inspect the network traffic it looks like for each query, a seperate HTTP request is initiated.

Can someone confirm this is the way it is supposed to work? or have i misconfigured something that would allow something like a persistent HTTP2 connection?

w--
  • 6,427
  • 12
  • 54
  • 92
  • 1
    I believe that Frank's answer (also featured on [#AskFirebase](https://www.youtube.com/watch?v=66lDSYtyils&feature=youtu.be&t=1m49s) relates to the Firebase RTDB, not Cloud Firestore. Cloud Firestore _might_ respond differently. – Jason Berryman Feb 11 '18 at 15:13
  • Jason is right, the answer you're referring is specific to the Firebase Realtime Database. Cloud Firestore uses a different protocol under the hood. But I wouldn't necessarily assume that it's much slower without testing it first. Also see Sam's answer here: https://stackoverflow.com/a/46773341/209103 – Frank van Puffelen Feb 11 '18 at 15:40
  • Hey frank, thanks for clarifying. I thought i had followed that link i posted from another answer you gave from someone asking specifically about firestore. may have been mistaken. It all kind of blurred together after reading a bunch. – w-- Feb 12 '18 at 01:35
  • @FrankvanPuffelen this is the answer you gave in the original thread i was reading where you allude that firestore reqs are pipelined. https://stackoverflow.com/questions/47532429/firebase-firestore-relational-data-design-approaches . – w-- Feb 12 '18 at 02:13
  • Thanks for finding that one, I'd been looking for it. :-) I since learned that the client/server interaction is quite different for Firestore. They're not pipelined over a single socket, but I'd still run tests before assuming the performance of multiple documents is bad. The logic of pipelining the requests will apply in the same situations, it just won't be over a single socket. – Frank van Puffelen Feb 12 '18 at 04:14

0 Answers0