Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Activate Google Cloud Datastore

This is a Preview release of the Cloud Datastore HTTP API. As a result, the API is subject to change and the service itself is currently not covered by any SLA or deprecation policy. These characteristics will be evaluated as the API and service moves towards General Availability, but developers should take this into consideration when using the Preview release of Cloud Datastore HTTP API.

The following describes how to activate the Google Cloud Datastore API, the quotas associated with this API, and how to enable billing. The activation process can vary based on your existing setup and environment.

Limitations

Cloud Datastore does not work with projects created with the older Google APIs console . So, if you have an existing API project, you will need to create a new one in the Google Cloud Console in order to use the Cloud Datastore API.

When you activate the Cloud Datastore API on a brand new Google Cloud Console project, a special builtin version is deployed that becomes the default version. If you subsequently deploy an App Engine app to that project, the Cloud Datastore builtin continues to be the default version, so requests to your app will instead be sent to the Cloud Datastore builtin. You can use the Admin Console to manually set your app as the default version.

Google Cloud Datastore for a new Cloud project

This scenario is focused on activating the Google Cloud Datastore API from a new Cloud project and accessing it from a Compute Engine VM instance.

To get started:

  1. Visit the Google Cloud Console .
  2. Create a new project and choose a Project Name and a Project ID .
  3. Enable Compute Engine .
  4. Go back to the main project page.
  5. Select APIs & auth from the left hand navigation.
  6. Scroll to the Google Cloud Datastore API .
  7. Switch Google Cloud Datastore API from OFF to ON .
  8. If you haven't already done this, install the Compute Engine gcutil tool and authenticate it to Google Compute Engine.
  9. Add a Compute instance and start it, following the instructions for starting an instance in the Google Compute Engine documentation. In addition to the project ID and the instance name, you must also specify both the datastore and userinfo.email scopes as shown here:

    gcutil --project <PROJECT_ID> addinstance <INSTANCE_NAME> --service_account_scopes=\
    https://www.googleapis.com/auth/userinfo.email,\
    https://www.googleapis.com/auth/datastore
    # replace <PROJECT_ID> with the Project ID you created previously.
    # replace <INSTANCE_NAME> with the name you want to use for your instance.
    
  10. Confirm that your instance is running .

  11. To use this new Compute Engine instance, connect to it using ssh .

At this point all services and authorizations are configured for your project and you can start writing code or exploring the API .

Google Cloud Datastore for an existing Cloud project with Compute Engine enabled

This scenario is focused on users who want to access the Google Cloud Datastore API from an existing Cloud project that has Compute Engine enabled.

To get started:

  1. Visit the Google Cloud Console .
  2. Select the existing Project ID for which the Google Cloud Datastore API should be enabled.
  3. Select APIs & auth from the left hand navigation.
  4. Scroll to the Google Cloud Datastore API .
  5. Switch Google Cloud Datastore API from OFF to ON .
  6. If you haven't already done this, install the Compute Engine gcutil tool and authenticate it to Google Compute Engine.
  7. Add a Compute instance and start it, following the instructions for starting an instance in the Google Compute Engine documentation. In addition to the project ID and the instance name, you must also specify both the datastore and userinfo.email scopes as shown here:

    gcutil --project <PROJECT_ID> addinstance <INSTANCE_NAME> --service_account_scopes=\
    https://www.googleapis.com/auth/userinfo.email,\
    https://www.googleapis.com/auth/datastore
    # replace <PROJECT_ID> with the Project ID you created previously.
    # replace <INSTANCE_NAME> with the name you want to use for your instance.
    
  8. Confirm that your instance is running .

  9. To use this new Compute Engine instance, connect to it using ssh . At this point all services and authorizations are configured for your project and you can start writing code or exploring the API .

Google Cloud Datastore for accessing an existing App Engine Datastore from Compute Engine

This scenario is focused on users who want to share data between an existing App Engine application and a new Compute Engine VM instance.

To get started:

  1. Visit the App Engine Admin Console .
  2. Select the Application ID for which the Google Cloud Datastore API should be enabled.
  3. Click the Application Settings link within the left hand navigation.
  4. Scroll to the Cloud Integration section.
  5. If no project is showing up, click Add Project . Project creation will take a few minutes, wait until you see your Google APIs Console Project Number in the Basics section of the Application Settings page.
  6. Click on the Google APIs Console Project Number link.
  7. Select APIs & auth from the left hand navigation.
  8. Scroll to the Google Cloud Datastore API .
  9. Switch Google Cloud Datastore API from OFF to ON .
  10. If you haven't already done this, install the Compute Engine gcutil tool and authenticate it to Google Compute Engine.
  11. Add a Compute instance and start it, following the instructions for starting an instance in the Google Compute Engine documentation. In addition to the project ID and the instance name, you must also specify both the datastore and userinfo.email scopes as shown here:

    gcutil --project <PROJECT_ID> addinstance <INSTANCE_NAME> --service_account_scopes=\
    https://www.googleapis.com/auth/userinfo.email,\
    https://www.googleapis.com/auth/datastore
    # replace <PROJECT_ID> with the Project ID you created previously.
    # replace <INSTANCE_NAME> with the name you want to use for your instance.
    
  12. Confirm that your instance is running .

  13. To use this new Compute Engine instance, connect to it using ssh .
  14. Your Dataset ID is the same identifier as your App Engine Application ID .

At this point all services and authorizations are configured for your project and you can start writing code or exploring the API .

Google Cloud Datastore for accessing existing App Engine Datastore from other Platform

  1. Visit the App Engine Admin Console .
  2. Select the Application ID for which the Google Cloud Datastore API should be enabled.
  3. Click the Application Settings link within the left hand navigation.
  4. Scroll to the Cloud Integration section.
  5. If no project is showing up, click Add Project . Project creation will take a few minutes, wait until you see your Google APIs Console Project Number in the Basics section of the Application Settings page.
  6. Click on the Google APIs Console Project Number link.
  7. Select APIs & auth from the left hand navigation.
  8. Scroll to the Google Cloud Datastore API .
  9. Switch Google Cloud Datastore API from OFF to ON .
  10. Click on Credentials from the left hand side menu.
  11. Click on CREATE NEW CLIENT ID .
  12. Select Service account and click Create Client ID . Your browser will download the private key.
  13. Your Service Account is the Email address displayed under the Service Account section.
  14. Your Private Key is the file you just downloaded.
  15. Your Dataset ID is your App Engine Application ID .

At this point all services and authorizations are configured for your project and you can start writing code or exploring the API .

Google Cloud Datastore from other platforms

This scenario is focused on users who want to access the Google Cloud Datastore API from an external application running on a different platform.

  1. Visit the Google Cloud Console .
  2. Create or select an existing Cloud project.
  3. Select APIs & auth from the left hand navigation.
  4. Scroll to the Google Cloud Datastore API .
  5. Switch Google Cloud Datastore API from OFF to ON (this may take a few moments) .
  6. Click on Credentials from the left hand side menu.
  7. Click on CREATE NEW CLIENT ID .
  8. Select Service account and click Create Client ID . Your browser will download the private key.
  9. Your Service Account is the Email address displayed under the Service Account section.
  10. Your Private Key is the file you just downloaded.
  11. Your Dataset ID is your new or existing Cloud Project ID .

At this point all services and authorizations are configured for your project and you can start writing code or exploring the API .

Quotas and billing

Quotas

The Cloud Datastore offers free quota that allows developers to get started at no cost. The resources and free quota amounts are listed below. When more quota is needed, developers will need to enable billing. Quotas are applied daily and reset around midnight Pacific time.

Total limit

It's important to note that data stored in the datastore may incur significant overhead. This overhead depends on the number and types of associated properties, and includes space used by built-in and custom indexes. Each entity stored in the datastore requires the following metadata:

  • 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 the datastore is schemaless, the name of each property must be stored with the property value for any given entity.
  • Any built-in and custom 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.

See How Entities and Indexes are Stored for a complete breakdown of the metadata required to store entities and indexes at the Bigtable level and How Index Building Works for a detailed explanation of how datastore indexes are managed.

Resource Free Default Daily Limit Billing Enabled Default Limit
Stored Data ( billable ) 1 GB * 1 GB free; no maximum
Number of Indexes 200 * 200
Write Operations 50,000 10 million per day **
Read Operations 50,000 10 million per day **
Small Operations 50,000 10 million per day **

* Not a daily limit but a total limit.
** The billing enabled limits are for Preview only. If you expect to exceed these limits while the service is in Preview please request a quota increase .

Billing

In order to take advantage of higher quotas, you will need to enable billing. To do so:

Google Cloud Datastore usage and billing is currently part of the App Engine billing system. This setup is for Preview only. Going forward, Google Cloud Datastore will be billed with its own SKU and separately of App Engine.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.