-
Scalable datastore for clients.
Google Cloud
Datastore is a fully managed, schemaless database for storing non-
relational data. Cloud Datastore automatically scales with your users
and supports ACID transactions, high availability of reads and writes,
strong consistency for reads and ancestor queries, and eventual
consistency for all other queries.
-
Your data in the cloud.
Each Cloud Datastore instance
is fully managed by Google so there is no planned downtime,
replication across multiple datacenters, automatic scaling as your
traffic increases, and monitoring by Google Engineers.
- Easy and flexible administration Cloud Datastore is accessible via HTTP using a JSON or Protocol Buffers API, running on top of the Google APIs infrastructure. Cloud Datastore offers Protocol Buffer client libraries for Java and Python as well as support for the Google APIs client libraries . In addition, Cloud Datastore offers a web-based interface for managing your Cloud Datastore instances, and a development server to support local development.
-
-
Sign up
- If you don't already have one, sign up for a Google account .
- Create a Google Cloud Datastore enabled project via the Google Cloud Console .
- Enable billing from your project's Settings tab.
- Enable the Google Cloud Datastore API .
-
Create a Google Compute instance
Google Developers Console
- From your project's overview page, in the left sidebar, select Compute Engine .
- Click New instance .
-
In the
NAME
box, enter
hello-datastore
. -
In the
ZONE
box, select the
us-central1-a
zone. -
In the
IMAGE
box, choose
Debian-7
. - Click Create .
Cloud SDK on Linux or Mac OS X
-
Download and install the Cloud SDK.
You can download and install the Cloud SDK using the following command:
$ curl https://sdk.cloud.google.com | bash
-
Restart your terminal to allow changes to your
PATH
to take affect.You can also run
source ~/. <bash-profile-file>
if you want to avoid restarting your terminal. -
Authenticate
to the
Google Cloud platform by running:
$ gcloud auth login
-
Create an instance.
gcutil --project <PROJECT_ID> addinstance hello-datastore --zone us-central1-a \ --service_account_scopes=https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/datastore
Replace
<PROJECT_ID>
with an existing project ID or the one you just created.
Cloud SDK on Windows
- Download the Cloud SDK and install it.
-
Launch
GoogleCloudSDKInstaller.exe
and follow the installation prompts. -
Authenticate
to the Google Cloud platform by
running:
$ gcloud auth login
-
Create an instance.
gcutil --project <PROJECT_ID> addinstance hello-datastore --zone us-central1-a \ --service_account_scopes= https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/datastore
Replace
<PROJECT_ID>
with an existing project ID or the one you just created.
-
Write data to Google Cloud Datastore from the instance
-
Connect to the instance using ssh. In the following command,
substitute your project's ID for <PROJECT_ID>.
$ gcutil --service_version="v1" --project="<PROJECT_ID>" ssh --zone="us-central1-a" "hello-datastore"
-
Install the
googledatastore
package, and download and unzip the latest
version of the
google-cloud-datastore
samples.
$ wget https://bootstrap.pypa.io/get-pip.py $ sudo python get-pip.py $ sudo pip install googledatastore --pre $ wget https://github.com/GoogleCloudPlatform/google-cloud-datastore/archive/v1beta2-rev1-2.1.1.tar.gz $ tar xvzf v1beta2-rev1-2.1.1.tar.gz
-
Run the sample code to write an entity to the datastore. In the
following command, substitute your project's ID for
<PROJECT_ID>.
$ python google-cloud-datastore-1beta2-rev1-2.1.1/python/demos/trivial/adams.py <PROJECT_ID> Meaning of life? > 42 fascinating, extraordinary and, when you think hard about it, completely obvious.
-
Optionally, in the
Google Developers Console
, view the entity.
From your project's overview page, select Cloud Datastore and then Query .
-
Connect to the instance using ssh. In the following command,
substitute your project's ID for <PROJECT_ID>.
-
What next?
- Read the Google Cloud Datastore documentation .
- Try a Getting Started guide with Node.js , Python , Java , or Ruby .
- Review pricing information .
- Learn about using Cloud Datastore with Google App Engine (e.g., see Python NDB Overview ).
- For high-volume accounts, see contact Google .