0
votes

my daily quotas has just been resetted so I figured out it was the moment to go on my Firestore user interface to know how much reads where counted simply by retrieving documents.

I have 11 documents each of them have 3 sub-collections (inside of them a certain number of documents) plus 1 dummy document with no sub collection and connecting to the firestore UI counts me 36 reads (1 document is opened - its sub collection are closed);

I though it was 1 read/document retrieved without taking in account sub collections?

36 reads how is this even possible? Would this mean my 12 documents are read 3 times each?

here is my data structure:

myCollection: {
  $docId: {
    data:myDate
    subCollection1:{
      $subDocId
    }
    subCollection2:{
      $subDocId
    }
    subCollection3:{
      $subDocId
    }
  }
}
1
theoretically this should be 1 read per doc. But ex. if you do get() on collection of 10 docs you will have 10 reads. As there are many ways to connect to Firestore, it would be good to add code example (stackoverflow.com/help/minimal-reproducible-example) - vitooh
@vitooh there is no code I'm connecting on the UI or the console if you prefer.This result is very strange don't you think so? - JSmith
@vitooh I'll try add a data example - JSmith
@vitooh I've added data structure. Thanks in advance - JSmith

1 Answers

1
votes

I have tested it on a completely fresh project. Indeed using the front end UI in the console it used around 2 times more than the number of documents. I created 6 documents with one field in one collection and every listing gave me usage of 12 reads. If you add some sub-collection it might be more.

But first of all I think that console UI is not meant to be used as a working interface, but rather for support/design purposes which means entered occasionally. With this assumption matter of cost effectiveness is less important. If you have 50 000 reads free each day and 0.036$ per 100 000 reads, a few hundred reads more when using the UI just not make any difference in costs.

The larger number of reads might be the result of implementation. Firestore is billed based on API calls, probably some items are queried even if they are not seen at the beginning to improve user experience or due to some other feature of the UI.

Firestore cost documentation here.