0

we have designed a new web page that contains college students and staff details. And we are using Cloud Firestore as our backend DB. When loading a web app we need to fetch all students and staff data's in one single request and display no of the present's and absent's count on the home screen. Firestore taking much time to get data from the database.

In the single query we need to get around 1.5L of students and staff details from the database, so it taking around 3-4 minutes to get data. How can we fix these issues?

halfer
  • 19,824
  • 17
  • 99
  • 186
Kavin Kumar Arumugam
  • 1,792
  • 3
  • 28
  • 47
  • use pagination instead of getting huge amount of data – Joel Joseph Dec 04 '19 at 10:18
  • @JoelJoseph I need to do some validation before displaying values, so I need to get all datas from DB – Kavin Kumar Arumugam Dec 04 '19 at 10:29
  • To me this sounds like a rather design/architectural issue. If your concern is performance, queries scale with the size of your result set, not the size of your data set, so you'll get the same performance fetching 1 result from a set of 100, or 100,000,000. See this [post](https://stackoverflow.com/questions/46603205/queries-scale-with-the-size-of-your-result-set-not-the-size-of-your-data-set). Now, I think data splits with query cursors can also be of great help, as @JoelJoseph mentioned. More info can be found [here](https://firebase.google.com/docs/firestore/query-data/query-cursors) – sllopis Dec 04 '19 at 14:45

0 Answers0