0

I have a Cloud Firestore database attached to an app that is currently in development. I have been seeing the read volume increasing day over day until it crossed the 50k reads/day threshold, even though the read volume that I am aware of deliberately creating is both unchanging and much smaller (~ few thousand reads/day). It appears that reads are coming from somewhere other than my usage...? Where are these coming from / what do I do about it? I do not think that they are coming from my actual usage.

I don't think that it makes sense to include code from the app. The codebase is large and it's not at all clear which part(s) of the code are relevant to this problem. As far as I can tell, other than the security rules, this isn't coming from the code at all.

I changed the security rules to prevent reads and writes altogether, per googles instructions:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read,write: if false;
    }
  }
}

and the hourly data shown in the Cloud Console Firebase>Usage tab did NOT go to zero as expected. Strangely, it initially appeared that it did, but the statistics later showed no change in read volume. Also, following Google's instructions I setup real time monitoring using Stackdriver, created a dashboard that shows Firestore Instance Resource and Document Reads Metric... and it shows no change. It continues to show about 1 query per second even when security rules should be preventing all reads/writes.

It is not clear where the reads are coming from, or how to diagnose the problem.

These reads are not coming from the cloud console itself, as I closed all instances with no change.

Help appreciated.

Thanks

user2330237
  • 1,629
  • 5
  • 20
  • 39
  • 2
    This question is NOT answered by the answer that was marked as a duplicate. I have now figured out the answer... but I'm not allowed to post it as someone apparently gets some points or something for disallowing my question. – user2330237 Oct 21 '19 at 15:17
  • What is the answer? I have the same problem and have had my post closed by the same moderator that disallowed discussion of your issue. Can you post your answer in the comments? This community is larger than a single moderator. – Mel Jul 25 '20 at 22:38
  • In my case, the 'phantom' reads were coming from an external source. I'd set up Zapier to check in on the database, and it was making the unexpected/not-remembered reads. Once I turned Zapier off, it went away. Perhaps a similar solution might be helpful for you. – user2330237 Jul 31 '20 at 13:53
  • Thanks for sharing. For others looking at this post and identifying the issue as different to that tagged as the duplicate post, this post has helpful input https://stackoverflow.com/questions/63009673/react-hooks-with-firestore-data-1-1k-reads-in-30-seconds-from-2-collections-w – Mel Jul 31 '20 at 21:33

0 Answers0