Usage and limits

Monitor your usage

When you create a Firebase project, you're also creating a project in the Google Cloud Platform. Use the App Engine Quotas page in the Cloud Platform Console to monitor your project's Cloud Firestore usage and storage costs.

Cloud Firestore includes a free tier to help you get started at no cost. After you exceed the usage and storage quotas for the free tier, you're charged for the database operations you perform, the data you store, and the network bandwidth you use.

Beta limits

The following table shows Cloud Firestore limits that apply only during the beta period.

Limit Details
Maximum writes per second per database (at beta) 2,500 (up to 2.5 MiB per second)
Maximum concurrent connections for mobile/web clients per database (at beta) 100,000

Free quota

Cloud Firestore offers free quota that allows you to get started at no cost. The free quota amounts are listed below. If you need more quota, you must enable billing for your Cloud Platform project.

Quotas are applied daily and reset around midnight Pacific time.

Free tier Quota
Stored data 1 GiB
Document reads 50,000 per day
Document writes 20,000 per day
Document deletes 20,000 per day
Network egress 10 GiB per month

Standard limits

In addition to the beta limits listed above, the following tables show the limits that apply to your usage of Cloud Firestore.

Collections, documents, and fields

Limit Details
Constraints on collection IDs
  • Must be valid UTF-8 characters
  • Must be no longer than 1,500 bytes
  • Cannot contain a forward slash (/)
  • Cannot solely consist of a single period (.) or double periods (..)
  • Cannot match the regular expression __.*__
Maximum depth of subcollections 100
Constraints on document IDs
  • Must be valid UTF-8 characters
  • Must be no longer than 1,500 bytes
  • Cannot contain a forward slash (/)
  • Cannot solely consist of a single period (.) or double periods (..)
  • Cannot match the regular expression __.*__
Maximum size for a document name 6 KiB
Maximum size for a document 1 MiB (1,048,576 bytes)
Constraints on field names Must be valid UTF-8 characters
Maximum size of a field name 1,500 bytes
Constraints on field paths
  • Must separate field names with a single period (.)
  • Must enclose each field name in backticks unless the field name meets the following requirements:
    • The field name contains only the characters a-z, A-Z, 0-9, and underscore (_)
    • The field name does not start with 0-9
Maximum size of a field path 1,500 bytes
Maximum size of a field value 1 MiB - 89 bytes (1,048,487 bytes)
Maximum depth of fields in a map 20

Writes and transactions

Limit Details
Maximum API request size 10 MiB
Maximum write rate to a document 1 per second
Maximum write rate to a collection in which documents contain sequential values in an indexed field 500 per second
Maximum number of documents that can be passed to a Commit operation or written in a transaction 500
Time limit for a transaction 270 seconds, with a 60-second idle expiration time

Indexes

Limit Details
Maximum sum of the sizes of a document's composite index entries 2 MiB
Maximum number of composite indexes for a database 200

Maximum number of index entries for each document

20,000

The number of index entries is the sum of the following for a document:

  • The number of single-field index entries
  • The number of composite index entries

Cloud Firestore automatically creates two single-field index entries for each field, one in the ascending index and one in the descending index.

Considering the limit of 20,000, each document can index a maximum of 10,000 fields minus the document's number of composite index entries.

Maximum size of an index entry

1500 bytes

Index entries over 1500 bytes are truncated. Queries involving truncated index values may return inconsistent results.

Security rules

Limit Details
Maximum number of exists(), get(), and getAfter() calls per request
  • 10 for single-document requests and query requests.
  • 20 for multi-document reads, transactions, and batched writes. The previous limit of 10 also applies to each operation.

    For example, imagine you create a batched write request with 3 write operations and that your security rules use 2 document access calls to validate each write. In this case, each write uses 2 of its 10 access calls and the batched write request uses 6 of its 20 access calls.

Exceeding either limit results in a permission denied error.

Some document access calls may be cached, and cached calls do not count towards the limits.

Maximum function call depth 20
Maximum number of recursive or cyclical function calls 0 (not permitted)
Maximum number of expressions in a ruleset 10,000
Maximum size of a ruleset 64 KB

Manage spending

To help avoid unexpected charges on your bill, set spending limits and alerts.

Set a daily spending limit

To cap your Cloud Firestore usage, set a daily spending limit through Google App Engine.

  1. If you haven't already, enable billing for your project in the Cloud Platform Console.
  2. Go to the App Engine Application Settings page in the Cloud Platform Console.
  3. Click Edit and set a Daily spending limit.
  4. Click Save. The new limit takes effect immediately and resets daily.

Set a monthly budget

To track your Cloud Firestore costs, create a monthly budget in the Cloud Platform Console. Budgets won't limit your usage, but you can set alerts to notify you when you're approaching or exceeding your planned costs for the month.

To set a budget, go to the Billing section in the Cloud Platform Console and create a budget for your billing account. You can use the default alert settings or modify the alerts to send notifications at different percentages of your monthly budget.

Learn more about setting a budget in the Cloud Platform Console.

Send feedback about...

Need help? Visit our support page.