Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Firebase charge for document writes that don't actually change any field values?

I have to update app version on Firestore on a field named appVersion in a document named userA. I update appVersion to Firestore and don't care about remote appVersion.

Will Firebase charge me money if remote appVersion equals local appVersion? Thanks.

EDIT: I'm using Blaze plan which I have to pay $0.18/100K. Look like it small but for huge users that is not.

I have a Firestore database like this. enter image description here I used this code in Android/Java to update appVersion:

String appVersion = "2.0.0";
App.getInstance().mFirestoreUsers
   .document("GgRu62z0b2CgQFbgNebe")
   .update("appVersion", appVersion)
   .addOnSuccessListener(aVoid -> {
      LogWrapper.i(TAG, "update appversion complete: " + appVersion);
 });

What i want to ask is, if user document on Firestore has appVersion value is "2.0.0" and i use above code to send the same value, will Firebase count up 1 write or 0?

like image 526
Truong Hieu Avatar asked Mar 05 '20 05:03

Truong Hieu


People also ask

How is Firebase billed?

Firebase bills for the data you store in your database and all outbound network traffic at the session layer (layer 5) of the OSI model. Storage is billed at $5 for each GB/month, evaluated daily. Billing is not affected by the location of your database.

What are the limitations of Firebase?

Rulesets must obey two size limits: a 256 KB limit on the size of the ruleset text source published from the Firebase console or from the CLI using firebase deploy . a 250 KB limit on the size of the compiled ruleset that results when Firebase processes the source and makes it active on the back-end.

What counts as a document read Firebase?

When you listen to the results of a query, you are charged for a read each time a document in the result set is added or updated. You are also charged for a read when a document is removed from the result set because the document has changed. (In contrast, when a document is deleted, you are not charged for a read.)

What is the maximum documents that are write by per transaction or batch of write in cloud firestore?

Each transaction or batch of writes can write to a maximum of 500 documents.


1 Answers

As per the Usage and limits documentation, the below are the free quota limits:

Free Quotas

Related to your question, yes, it will charge, since it's a new write to the database. It won't matter if you are just writing again the same value or a new one. Firestore won't check if the value is the same or not, it will charge per writing on the database.

In addition to that, I would recommend you to look at the documentation See a Cloud Firestore pricing example, for you to check how it's charged and the pricing works on Firestore. Besides that, it provides some examples of how to calculate, for you to check it.

Let me know if the information helped you!

like image 140
gso_gabriel Avatar answered Sep 22 '22 00:09

gso_gabriel