0

I obtained a firestore database with 2 collections of patients and appointments and I am trying to make a query to fill an appointment table in an html view that also contains patient information, however, since firestore does not handle the union between documents, I don't know how it could affect performance if for each appointment document, call the patient's collection and, therefore, get the related data.

Is the Firestore API smart enough to join all those queries and make a single HTTP request?

I am currently using Java with the Firestore administration API to perform queries.

Jorge L. Morla
  • 630
  • 5
  • 14

1 Answers1

1

The Firestore clients use HTTP2 to communicate with the server when possible. The requests will be pipelined over a single connection in that case.

Alternatively, consider duplicating the minimal data for each patient into their appointment documents. This type of data duplication is quite common in NoSQL databases, and is a typical trade-off of write performance/code cost vs read performance.

Also see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807