Reputation: 3964
I am using Google Cloud Firestore
for storing the Data. Assume I have a simple collection of cities
.
Assume I have 10,000 City Documents stored in my cities
Collection. What is the Running time for querying a document with a particular Id (Ex : "city_123"). Is it constant in time or it is comparable to the size of the Documents ?
Upvotes: 0
Views: 894
Reputation:
Firestore is designed to automatically scale based on user demand. Regardless of the size of the database, you will get the same performance out of it. Query time will not depend on the size of the database.
Cloud Firestore performs automatic, multi-regional replication to reduce any latency.
So in case, you query 5 docs from the dataset of size 10,000 or you query 5 docs from the dataset of size 10,000k, the query time will be same. Query time is related to the size of results to return.
Upvotes: 0
Reputation: 138824
The time for querying a Collection that contains 10,000 documents is constant but the transfer time can never be constant. It depends on the size of the document that is queried. Another important factor is the bandwidth that the user has on his device. Both are contributing to the time that will take to query that document.
To reduce the time, i suggest you reduce the amount of data by filtering using one of the filtering methods. Here is the official documentation.
Upvotes: 2