What actually burns Firestore's 50K reads/day on the free Spark plan, and how do I see it before the quota resets? Quota hit
Small app, a few hundred users, and I keep exhausting the Firestore read quota by mid afternoon.
The no-cost limits on the Firebase pricing page today are 50K document reads/day, 20K writes/day, 20K deletes/day, 1 GiB stored and 10 GiB/month egress, and the daily ones reset around midnight Pacific. Checked those this morning rather than quoting from memory, because I have found stale numbers in three different blog posts already.
The part I cannot explain is the ratio. Traffic is flat but reads are not. Some days 12K, some days over 50K, with no matching change in sessions. So it is something structural in the app rather than popularity.
Before I start rewriting queries at random:
- What are the usual causes of read counts far larger than the number of things a user actually looked at?
- Is there any way to attribute reads to a query or a screen, rather than staring at one daily total after the fact?
- Does anything other than user traffic count against it?
@edge_runtime_bo · 2d ago · 2 replies
Listeners, almost certainly.
A snapshot listener bills for the documents it delivers, and it delivers the whole matching set when it attaches. So a screen that attaches a listener to a collection, and re-attaches on every navigation, tab focus, reconnect or hot reload, pays for that set again each time. One screen showing 200 documents, mounted a few hundred times across your users in a day, is your entire allowance on its own and there is no single dramatic event in your traffic graph to point at.
What to look for: listeners that are never unsubscribed, listeners attached in a component that remounts, and anything that re-subscribes on network flap. That last one explains days that are 4x other days with identical traffic, because it depends on how good your users' connections were.
Reply
Report
@oncall_omar · 20h ago
And a dev tab left open overnight with a live listener attached will quietly consume a day's allowance while you sleep, which is the single most demoralising way to discover this. Check that before you conclude your users are doing something weird.
Reply
Report