首页 文章

是否可以在GAE flex环境中使用appengine / datastore包?

提问于
浏览
1

Google App Engine有两种不同的数据存储包:google.golang.org/appengine/datastorecloud.google.com/go/datastore .

b28126 for appengine / datastore包使用标准环境,而the documentation for cloud包使用flex环境 .

我有一个Go应用程序,它使用标准GAE环境中的appengine / datastore包 . 如果我想将此应用程序从标准环境迁移到flex环境,是否需要切换到cloud.google.com/go/datastore软件包,还是可以继续使用appengine / datastore软件包?如果没有,为什么不呢?

1 回答

  • 1

    您需要迁移到cloud.google.com/go/datastore .

    来自Migrating Services from the Standard Environment to the Flexible Environment

    App Engine灵活环境不提供App Engine SDK中存在的API库 . 如果您决定将应用程序从App Engine标准环境迁移到灵活环境,则必须更新代码以使用所有Google Cloud Platform环境中可用的服务和API .

    Cloud Datastore

    您可以使用Cloud Datastore API从任何地方访问Google Cloud Datastore . 使用Google Cloud客户端库存储和检索Cloud Datastore中的数据 . 无论您是使用App Engine库,Google Cloud客户端库还是直接调用API,都可以使用相同的Cloud Datastore数据 . 此时,标准环境中可用的ORM库(如ndb和Objectify)在标准环境之外不受支持 . 有关更多信息,请参阅以下指南:使用 Cloud 数据存储

相关问题