Writing Datastore controller for appengine and GCE?

50 views
Skip to first unread message

Alex Buchanan

unread,
Nov 19, 2017, 8:43:22 PM11/19/17
to Google App Engine
I've written some API code using Datastore and the cloud.google.com/go/datastore library. As I started to look into deploying to Appengine, I realized there are some hurdles to having this code available in both Appengine and GCE. I see there is a separate library for in google.golang.org/appengine/datastore, with a different API.

I'd like to use the standard environment if possible.

Is there a way to use cloud.google.com/go/datastore from the Appengine standard environment?

Thanks,
Alex

For reference, the code is here: https://github.com/buchanae/funnel/tree/datastore-2/server/datastore

Jordan (Cloud Platform Support)

unread,
Nov 20, 2017, 11:21:57 AM11/20/17
to Google App Engine
If you are looking to deploy to App Engine Standard it is recommended to follow its documentation. Currently the App Engine Standard Go environment is not recommended to use the new Google Cloud Client Libraries which allows access to Google Services from any client such as a Google Compute Engine VM. 

As also reiterated in the documentation for the Cloud Datastore API, the App Engine Standard Go environment is currently limited to the use of the older App Engine SDK as opposed to the new Google Cloud Client Library for Go.

- Note that you could indeed try to use the new Google Cloud Client Library for Go on the App Engine Standard Go environment, but as it is not fully supported yet you may run into issues. It is recommended to report all issues and feature requests specific to the Google Cloud Client Library for Go directly to the engineering team in their Git Issue Tracker

Alex Buchanan

unread,
Nov 20, 2017, 9:06:49 PM11/20/17
to Google App Engine
Ah, well, I have been digging through that documentation for weeks now, on and off. There is quite a bit of it, so I missed that note. Thanks for pointing it out. It took me awhile to realize that there were even two separate Go APIs. Maybe I skim too much.

I ended up rewriting my api calls to use the appengine library. I need my task workers to live in GCE though, so I'm not sure how that all plays out yet. I might have to give up on appengine for now.

I'm sure you guys are aware of the pitfalls here and are working on resolving it. Thanks again for your help.

Jordan (Cloud Platform Support)

unread,
Nov 21, 2017, 10:18:48 AM11/21/17
to Google App Engine
Our engineering team is working very hard to providing full Google Cloud Client Library support for the App Engine Standard runtimes.  

In the meantime if you require your application to run on both App Engine and Compute Engine you may want to look into the App Engine Flexible environment. In Flex the App Engine instances run on Compute Engine VMs allowing for the use of the Google Cloud Client Libraries.
Reply all
Reply to author
Forward
0 new messages