Skip to content

Cloud Firestore quota errorWhy does Firestore say I exceeded my quota?

Firestore stops answering and the error mentions a quota. Often, something in the app reads more documents than expected. Here’s where the reads come from and how to cut them, or hand it over at a fixed price.

Short answer

On the free quota, Firestore allows 50,000 document reads, 20,000 writes and 20,000 deletes a day, reset around midnight Pacific time. Hitting the limit usually means something reads the same documents again and again: listeners that reconnect, queries with no limit, offsets, security rules that read other documents, or counting by downloading a whole collection. Check the Usage tab, fix the biggest source, or enable billing and set a budget alert, knowing a budget doesn’t cap usage.

Where the reads come from, and the fix

  1. 01

    The free daily quota ran out

    “Quotas are applied daily and reset around midnight Pacific time.” Firebase, Usage and limits

    Without billing, Firestore gives you a fixed amount each day: 50,000 document reads, 20,000 writes, 20,000 deletes and 1 GiB stored. Once one runs out, Firebase says more quota needs billing; the free amounts come back at the daily reset. Open the Usage tab in the Firebase console to see which limit you hit, then find the code behind it before enabling billing.

  2. 02

    Listeners that keep reconnecting

    “If offline persistence is disabled, you will be charged for documents and index entries read as if you had issued a brand-new query whenever the listener disconnects and reconnects.” Firebase, Understand Cloud Firestore billing

    A realtime listener is billed like a query when it starts, then one read each time a document in its results is added or updated. If a screen attaches a listener each time it opens, or the connection drops, Firestore can bill the full result again. Attach listeners once and detach them when the screen closes. Without offline persistence, every reconnect is billed as a new query; with it, only a disconnect of more than 30 minutes is.

  3. 03

    Queries with no limit, or with offsets

    “However, when you send a query that includes an offset, you are charged a read for each skipped document.” Firebase, Understand Cloud Firestore billing

    Firestore bills every document a query reads, so a query with no limit reads the whole collection even if the screen shows 20. Add a limit and page with cursors. Offsets look cheaper but aren’t: every skipped document still counts as a read.

    import { collection, query, orderBy, limit, startAfter, getDocs } from "firebase/firestore";
    
    const first = await getDocs(query(collection(db, "posts"), orderBy("createdAt"), limit(20)));
    const last = first.docs[first.docs.length - 1];
    const next = await getDocs(query(collection(db, "posts"), orderBy("createdAt"), startAfter(last), limit(20)));
  4. 04

    Security rules that read other documents

    “You are charged for reads that are necessary to evaluate your Cloud Firestore Security Rules .” Firebase, Understand Cloud Firestore billing

    Rules that call get() or exists() to look up a user or role document add reads to requests from your app. Keep the lookups you need, and drop the ones you don’t.

  5. 05

    Counting by downloading every document

    “For example, count() operations that read between 0 and 1000 index entries are billed for one document read.” Firebase, Understand Cloud Firestore billing

    Fetching the whole collection to count it on the device is billed for every document read. A count() aggregation query is billed by index entries instead: up to 1,000 of them cost one document read.

    import { collection, getCountFromServer } from "firebase/firestore";
    
    const snap = await getCountFromServer(collection(db, "orders"));
    console.log(snap.data().count);

Checked against the vendor’s docs on : Firebase docs: Usage and limits for Cloud Firestore; Firebase docs: Understand Cloud Firestore billing.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Firestore “The query requires an index” · Firebase “Missing or insufficient permissions” · How to cut your Firebase bill · Unexpected Gemini API charges on Firebase

Questions

More on this error

When does the Firestore quota reset?

Firebase says the daily quotas reset around midnight Pacific time. If you can’t wait, Firebase says more quota needs billing enabled.

Will enabling billing stop the error?

Firebase says that if you need more quota, you must enable billing. Set a budget with alerts first, but note Firebase says budgets won’t limit your usage, so fix the code that reads too much as well.

Does a query with no results still count?

Yes. Firebase charges a minimum of one document read for each query, even when it returns nothing.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; we reply by email, usually within one business day.