gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 02:12:20 25 4
gpt4 key购买 nike

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

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

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

最佳答案

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

来自 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.

来自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:

关于google-app-engine - 是否可以在 GAE flex 环境中使用 appengine/datastore 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42870351/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com