Python 2.7 has reached end of supportand will bedeprecatedon January 31, 2026. After deprecation, you won't be able to deploy Python 2.7applications, even if your organization previously used an organization policy tore-enable deployments of legacy runtimes. Your existing Python2.7 applications will continue to run and receive traffic after theirdeprecation date. We recommend thatyoumigrate to the latest supported version of Python.

Using Cloud Firestore in Datastore Mode

Firestore is a NoSQL document database built for automatic scaling,high performance, and ease of application development. It is the newest versionof Datastore and introduces several improvements overDatastore.

Because Firestore inDatastore modeis optimized for server use cases and forApp Engine, we recommend using Firestore inDatastore mode for databases that will be used primarily byApp Engine apps. Firestore in Native mode is most useful formobile and real-time notification use cases. For more information aboutFirestore modes, seeChoosing between Native Mode andDatastore mode.

Using Datastore mode with App Engine

To use Datastore mode with App Engine:

  1. If you haven't already done so,create a databaseand choose Firestore in Datastore mode.

    You can use existing Datastore databases with App Engineapps. These existing databaseswill be automatically upgraded toFirestore in Datastoremode.

  2. Use Cloud NDB)

    to create, retrieve, and manage entities in your Datastore modedatabase.

If you are planning to upgrade your Python 2 app to Python 3, you have a few options:

For additional resources plus an example of migrating from a Python 2webappapp using App Engine NDB to an equivalent Python 3 Flask app with App Engine NDBenabled, see thebundled services for Python 3page.

Configuring indexes

Datastore mode usesindexesfor every query your application makes. The indexes are updated whenever anentity changes, so the results can be returned quickly when the app makes aquery.

Datastore mode automatically creates single-property indexes for use withsimple types of queries. For complex queries that include multiple properties,you'll need to configure composite indexes in your app'sindex.yaml file.

The App Engine development server will update yourindex.yaml filewith the composite indexes needed to run your tests. Similarly, theDatastore mode emulator can generate indexeswhen you run tests.

You can also add the indexes to your app'sindex.yaml filemanually if you do not run localtests or your tests do not include complex queries.

Setting database permissions

By default, your app has all the permissions required to read and write toDatastore mode and Firestore databases in yourGoogle Cloud project.

To manage these permissions, each App Engine app uses adefault serviceaccountthat gives full read and write access to Datastore modeand Firestore databases in the same project as the app. You canchange the permissions of the default serviceaccount,but your app may lose access unless you assign an IAM role with therequired permissions.

For information about allowing other users, apps, or projects to access a database, seeAccessing your database.

Pricing, quotas, and limits

Datastore mode offers a free quota with daily limits. Paidaccounts offer unlimited storage, read, and write operations. More informationis available on theDatastore Quotas page.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.