1
votes

There are two different datastore packages for Google App Engine: google.golang.org/appengine/datastore and cloud.google.com/go/datastore.

The documentation for the appengine/datastore package uses the standard environment while the documentation for the cloud package uses the flex environment.

I have a Go application which uses the appengine/datastore package on the standard GAE environment. If I want to migrate this application from the standard environment to the flex environment do I need to switch to the cloud.google.com/go/datastore package, or can I continue using the appengine/datastore package? If not, why not?

1

1 Answers

1
votes

You need to migrate to cloud.google.com/go/datastore.

From Migrating Services from the Standard Environment to the Flexible Environment:

The App Engine flexible environment does not provide the API libraries present in the App Engine SDK. If you decide to migrate your application from the App Engine standard environment to the flexible environment, you must update your code to use services and APIs that are available across all Google Cloud Platform environments.

And from Cloud Datastore:

You can access Google Cloud Datastore from anywhere using the Cloud Datastore API. Use the Google Cloud client libraries to store and retrieve data from Cloud Datastore.

The same Cloud Datastore data is available regardless of if you use the App Engine libraries, the Google Cloud client libraries, or call the API directly.

At this time ORM libraries that available in the standard environment such as ndb and Objectify are not supported outside of the standard environment.

For more information, see the following guide: