Skip to content

Latest commit

 

History

History
 
 

App Engine Datastore NDB Overview Sample

Open in Cloud Shell

This is a sample app for Google App Engine that demonstrates how to replace use of the Datastore NDB Python API with the Google Cloud NDB library. This library can be used not only on App Engine, but also other Python 3 platforms.

This sample also uses Memorystore for Redis caching to improve NDB performance in some situations.

Prior to deploying this sample, a serverless VPC connector must be created and then a Memorystore for Redis instance on the same VPC. The IP address and port number of the Redis instance, and the name of the VPC connector should be entered in either app.yaml (for Python 2.7) or app3.yaml (for Python 3).

To deploy and run this sample in App Engine standard for Python 2.7:

pip install -t lib -r requirements.txt
gcloud app deploy app.yaml index.yaml

To deploy and run this sample in App Engine standard for Python 3.7:

gcloud app deploy app3.yaml index.yaml