Google Cloud Datastore

Activate Google Cloud Datastore

This is a Preview release of the Cloud Datastore. 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.

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.

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

Resource Free Quota Limit Billing Enabled Limit
Stored Data (billable) 1 GB No limit
Number of Indexes 200 200

Daily limit

Resource Free Quota Limit Billing Enabled Limit
Write Operations 50,000 10 million per day, no more than 500 per second
Read Operations 50,000 10 million per day, no more than 500 per second
Small Operations 50,000 10 million per day, no more than 500 per second

The billing enabled limits are for Preview only. If you expect to exceed these limits while the service is in Preview please contact support.

Billing

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

  • Navigate to Google Cloud Console.
  • Select the project for which billing should be enabled
  • Select Cloud Datastore and follow the instructions in the lower left corner.

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.