Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore Pricing - Does The Amount Of Documents In A Collection Matters?

Tags:

I have read in the documentation that I'm being charged for the amount of the requests I'm making to read, write or update documents. I have also read that reading a collection is priced the same as a reading a document ("For queries other than document reads, such as a request for a list of collection IDs, you are billed for one document read."), correct me if I'm wrong.

My question is: Does reading a collection with a big amount of documents in it (let's say - 10,000 documents) is priced the same as reading one with 10?

I'd like to get some explaination about it...

like image 484
Tal Barda Avatar asked Nov 06 '17 21:11

Tal Barda


People also ask

How many documents can a collection hold firestore?

20 for multi-document reads, transactions, and batched writes. The previous limit of 10 also applies to each operation.

How does Firestore pricing work?

Cloud Firestore includes a no-cost tier to help you get started at no cost. After you exceed the usage and storage quotas for the no-cost tier, you're charged for the database operations you perform, the data you store, and the network bandwidth you use.

How many documents can Firebase handle?

Keep the rate of documents the database pushes to all clients under 1,000,000 documents/second. This is a soft limit.

Is firestore cost effective?

Although Firestore is very affordable with little usage, costs start to increase as you begin to scale. In most cases, the cost of using Firestore at scale is more expensive than other providers.


1 Answers

It depends on what you mean by "reading a collection", but for most people this means "querying a bunch of documents from a collection". And the answer is that the pricing generally depends on the number of documents retrieved.

To oversimplify things just a bit:

If you have a collection of 10 employees and you run a collection("employees").get() call, you will get back 10 employee documents, and be charged for 10 reads.

If you have a collection of 10,000 employees and you run a collection("employees").get() call, you will get back 10,000 employees, and be charged for 10,000 reads.

If you have a collection of 10,000 employees and you run a collection("employees").get().limit(10) call, you will get back 10 employees, and be charged for 10 reads.

If you have a collection of 10,000 employees, 4 of which are named "Courtney" and you run a collection("employees").where("first_name", "==", "Courtney") call, you will get back 4 employees and be charged for 4 reads.

like image 116
Todd Kerpelman Avatar answered Oct 10 '22 16:10

Todd Kerpelman