0
votes

Last couple of weeks, I have been Observing difference between number of writes in Firebase console Firestore Usage tab and Google cloud console Quota page.

Before that, The count fairly used to sync.

Number of writes in Firebase Firestore console usage tab: 9.2K

Number of writes in Google Cloud Console page, Quotas Page: 19307

Which is approximately double the number of writes in Firebase Firestore Usage Tab. Are there any Internal writes happening which google doesn't report?

Firebase Console Firestore Usage Tab Page

Google cloud Console Quotas page

I have attached the screenshots for the same.

Can anyone clear My Query. Is this a valid Scenario? Note: I Don't have any other project linked to the platform.

2

2 Answers

0
votes

From your first screenshot you can see at the top left written on the graph “Does not include Imports/exports and may not match billing and quota usage”. Moreover, Google public documentation states that the Firebase console includes a usage dashboard that shows Cloud Firestore reads, writes, deletes and other metrics over time.

As a result of how the dashboard computes usage, the numbers reported can differ from billing reports. The billing reports are the final usage numbers.

The usage dashboard does not include reads and writes from managed import and export operations.

0
votes

So,I have to answer my question.

I've found out the root cause. Firestore FieldValue atomic operations causing the double writes. This double writes happening with any SDK version even in Cloud functions Admin SDK. I've skipped the use of atomic operations using FieldValue. All Fine now.

Firebase Support Investigating the Issue. Will update When I Got more Info from them.

Edit:2

Response from Firebase support: "The two writes come from: 1) the initial write and 2) the transformation. This is not a bug, and what is shown in the Cloud console is correct. We do have an internal ticket now to make sure the Firebase console syncs up this information better, as well, so hopefully that'll help."

That means Fieldvalue functions to increment and array Union, servertimestamp will cause two writes and I also found that they are causing extra reads as well. I feel Firebase should reconsider their decision of not considering it as bug or atleast restructure this Atomic Operation. Let's Wait and See.