Firestore in Datastore mode pricing

This document explains Datastore mode pricing details.

Free usage

Firestore in Datastore mode offers free usage that allows you to get started at no cost. To exceed the free usage, you must enable billing for your project.

Your usage is counted daily and resets around midnight Pacific time.

Free usage
Entity reads 50,000 per day
Entity writes 20,000 per day
Entity deletes 20,000 per day
Stored data 1 GiB
Small operations 50,000 per day
Outbound data transfer 10 GiB per month

The following operations and features do not include free usage. You must enable billing to use these features:

  • PITR data
  • Backup data
  • Restore operations
  • TTL

For more information about how these features are billed, see Storage size consideration.

Pricing by region

To view pricing for reads, writes, deletes, and storage for each Datastore mode location, see Firestore pricing.

Read operations

You are charged one read operation for each entity read and one read operation for each batch of up to 1000 index entries read.

Index entries

You are charged one read operation for each batch of up to 1000 index entries read by a query except in the following:

Queries that have up to one range property are not charged for index entries read and have a minimum charge of zero read operations. Use the following examples to familiarize yourself with when index entries read is charged. Then use the billing_details section of Query Explain to validate your understanding.

The following query contains one equality property (age) and one range property (start_date) and is not charged for index entries read:

Query<Entity> query =
    Query.newEntityQueryBuilder()
        .setKind("Employee")
        .setFilter(
            CompositeFilter.and(
                PropertyFilter.eq("age", 35), PropertyFilter.ge("start_date", new Date(2020, 1, 1))))
        .build();

The following query contains two range properties (age and start_date) and is charged for index entries reads:

Query<Entity> query =
    Query.newEntityQueryBuilder()
        .setKind("Employee")
        .setFilter(
            CompositeFilter.and(
                PropertyFilter.ge("age", 35), PropertyFilter.ge("start_date", new Date(2020, 1, 1))))
        .build();

A property that appears in the order by clause is considered a range property when there is at least one other range property. Therefore the following query contains two range properties (age and start_date) and is charged for index entries reads:

Query<Entity> query =
    Query.newEntityQueryBuilder()
        .setKind("Employee")
        .setFilter(PropertyFilter.ge("age", 35))
        .setOrderBy(OrderBy.asc("start_date")).build()
        .build();

A property that appears in the distinct on clause is considered a range property when there is at least one other range property. Therefore the following query contains two range properties (age and start_date) and is charged for index entries reads:

Query<Entity> query =
    Query.newEntityQueryBuilder()
        .setKind("Employee")
        .setFilter(PropertyFilter.ge("age", 35))
        .setDistinctOn("start_date")
        .build();

Aggregation queries

For the aggregation queries count(), sum(), and avg(), you are charged one entity read for each batch of up to 1000 index entries read by the query.

For example, aggregation queries that read between 0 and 1000 index entries are billed for one entity read. For an aggregation query that reads 1500 index entries, you are billed 2 entity reads.

To learn more about the indexes used and the index entries read, use Query Explain.

Property transforms

Each property transform operation like increment and appendMissingElements is charged for a read and a write. A commit operation with an insert, update, or upsert and a property transform on the same entity counts as one read and one write.

Small operations

Small operations include:

  • Calls to allocate IDs.
  • Keys-only queries. A keys-only query is counted as a single entity read for the query itself. The individual results are counted as small operations.
  • Projection queries that do not use the distinct on clause. This type of query is counted as a single entity read for the query itself. The individual results are counted as small operations.

Small operations are free, but you must enable billing to exceed the free usage per day.

Query Explain and Analyze

Use of the Query Explain and Analyze incurs costs.

When a query is explained with the default option, no index or entity read operations are performed. Regardless of query complexity, one read operation is charged.

When a query is explained with the analyze option, index and read operations are performed, so you are charged for the query as usual. There is no additional charge for the explain and analyze activity, only the usual charge for the query being executed.

Network bandwidth

You are charged for the network bandwidth used by your Firestore in Datastore mode requests, as shown in the following sections. The network bandwidth cost of a request depends on the request's response size, the location of your Datastore mode database, and the destination of the response.

General network pricing

For requests that originate within Google Cloud Platform (for example, from an application running on Google Compute Engine), you are charged as follows:

Traffic type Price
Inbound data transfer Free
Data transfer within a region Free
Data transfer between regions in the same multi-region Free
Data transfer between regions within the US (per GiB) $0.01 (first 10 GiB per month are free)
Data transfer between regions, not including traffic between US regions Google Cloud Platform internet outbound data transfer rates

If you pay in a currency other than USD, the prices listed in your currency on Cloud Platform SKUs apply.

Internet data transfer rates

You will be charged for internet data transfer for the following:

  • Google Cloud requests between regions, not including traffic between US regions
  • Requests from outside of Google Cloud

If you pay in a currency other than USD, the prices listed in your currency on Cloud Platform SKUs apply.

Export and import operations

Export and import operations are charged for entity reads and writes at the rates shown in the table above. If you cancel an export or import, you will be charged for operations performed up until the time that the cancel request has propagated through Firestore in Datastore mode.

Locating quota usage information for your app

To see your application's Datastore mode usage, including quota consumption, visit the App Engine Quota Details page. You'll need to do this even if your application does not run in App Engine.

The Datastore mode resources used by your application are listed in the Storage page that is displayed. You can optionally click Show resources not in use to take a look at the complete list of quota information that is available.

Storage size consideration

You are charged for the amount of data that you store in Datastore mode, including storage overhead. The amount of overhead includes metadata, built-in indexes, composite indexes, and point-in-time recovery (PITR) versions. You are also charged for backup storage size and for restore operations.

Each entity stored in your database requires the following metadata which contribute to storage size:

  • The entity key, including the kind, the ID or key name, and the keys of the entity's ancestors.
  • The name and value of each property. Since Firestore in Datastore mode is schemaless, the name of each property must be stored with the property value for any given entity.
  • Any built-in and composite index rows that refer to this entity. Each row contains the entity kind, any number of property values depending on the index definition, and the entity key.

Learn how Datastore mode storage is calculated at Storage Size Calculations.

PITR data

If you enable PITR, you are charged for the storage of PITR data. Most customers will find that the overall cost of PiTR data storage is similar to the storage cost of the database.

Storage costs for PITR are in GiB/month and calculated daily. Datastore mode measures the database size daily. Over the period of a month, these sample points are averaged to calculate the database storage size. This average value is multiplied by the unit price of PITR (GiB-month).

For example, if the average size of your database during a month is 1 GiB and PITR is enabled for the whole month, then the billable PITR data size is 1 GiB as well.

Minimum billing: You may be charged up to 1 day of PITR storage cost even if you disable PITR within a day after enablement.

Backup data and restore operations

If you enable backups, you are charged for the storage of your database backups. The storage size for a backup is equal to the storage size of the database when the backup was taken.

Storage costs for backups are in GiB/month. Over the period of a month, the number of days for which each backup is retained, averaged over the month is also calculated. The cost of each backup is calculated using the storage size of the backup multiplied by the proportion of the month the backup is retained, multiplied by the unit price. Day boundaries are defined by the America/Los_Angeles time zone for billing purposes.

When you perform a restore operation, Datastore mode measures the size of the backup for the restore operation. The size of the backup is multiplied by the unit price of restore operations (GiB).

What's next

Request a custom quote

With Google Cloud's pay-as-you-go pricing, you only pay for the services you use. Connect with our sales team to get a custom quote for your organization.
Contact sales