Home > Net >  Best way to store a lot of geopoints in Firestore
Best way to store a lot of geopoints in Firestore

Time:12-08

Let's say I have thousands and thousands Geopoints all around the world to store in Firestore. I will query the ones in a certain radius, then display them on a map.

Is it a bad idea to put every objects which contain the geopoints in one big collection? Or will it get significantly slower the more data I add?

And if it is, what would be a better database structure?

CodePudding user response:

The number of documents in a collection has no impact on the performance of a Firestore query, that's pretty much its main performance guarantee.

If you retrieve 10 documents from 1,000 documents in the collection, the performance will be the same as when you retrieve those 10 documents when there are 1,000,000 documents in that collection.

While other limitations and behaviors of Firestore may affect the data model you decide on, query performance typically isn't one of them.

  • Related