【问题标题】:Is it possible to use the appengine/datastore package on the GAE flex environment?是否可以在 GAE flex 环境中使用 appengine/datastore 包?
【发布时间】:2017-03-18 04:09:21
【问题描述】:

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

appengine/datastore 包的The documentation 使用标准环境,而云包的the documentation 使用flex 环境。

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

【问题讨论】:

    标签: google-app-engine go google-cloud-datastore


    【解决方案1】:

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

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

    App Engine 柔性环境不提供 API 库 存在于 App Engine SDK 中。如果您decide to migrate your application from the App Engine standard environment to the flexible environment,则必须更新您的代码以使用服务和 API 可在所有 Google Cloud Platform 环境中使用。

    来自Cloud Datastore

    您可以在任何地方使用Google Cloud Datastore 云数据存储 API。使用Google Cloud client libraries 来 从 Cloud Datastore 存储和检索数据。

    无论您是否使用相同的 Cloud Datastore 数据,都可以使用 App Engine 库、Google Cloud 客户端库或调用 直接使用 API。

    目前在标准环境中可用的 ORM 库 例如 ndbObjectify 在外部不受支持 标准环境。

    有关详细信息,请参阅以下指南:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-02
      • 2017-09-25
      • 1970-01-01
      • 2017-05-29
      • 1970-01-01
      • 2010-10-25
      • 1970-01-01
      相关资源
      最近更新 更多