允许一个App Engine应用访问另一个App Engine应用的数据存储。

huangapple go评论92阅读模式
英文:

Allowing an App Engine app to access another App Engine app's datastore

问题

我有一个情况,一个现有的GAE应用(我们称之为应用A)正在运行,但由于非技术原因无法进行修改。随着用户迁移到新的客户端版本,我们需要将他们的数据从应用A迁移到一个新的GAE应用(我称之为应用B)。

有没有一种方法可以在不修改应用A的情况下,让应用B访问应用A的实时数据存储?我所说的不修改是指不需要部署新代码。在Cloud Console中更改设置或权限是可以的。

如果有关系的话,我所提到的这两个应用都是用Go语言编写的。

英文:

I have a situation where an existing GAE App (let's call it app A) is running, but for non-technical reasons can't be modified. As users migrates to a new client version, we need to migrate their data from app A to a new GAE app (which I'll call app B).

Is there a way that I can grant app B access to app A's live datastore without modifying app A? My not modifying I mean not having to deploy new code. Changing setting or permissions in the Cloud Console is fine.

In case it matters, both apps that I'm referring to are written in Go.

答案1

得分: 1

可能无法使用Google App Engine标准环境客户端库在多个GAE应用程序之间共享数据存储。至少对于Python而言,这是不可能的,关于Go语言我不确定。

但是,可以使用Cloud Datastore客户端库在许多应用程序之间共享数据存储,甚至可以从Google Cloud之外的位置进行访问。

无论旧应用程序如何访问数据存储(语言/库等),都可以从Cloud Console进行配置,以允许远程应用程序访问。具体的步骤可以在https://stackoverflow.com/questions/42051453/how-do-i-use-google-datastore-for-my-web-app-which-is-not-hosted-in-google-app-e/42060551#42060551中找到。

新应用程序将使用上述提到的客户端库和旧应用程序的服务帐号凭据(在上一段中获取)来访问旧应用程序的数据存储。

英文:

It might not be possible to share the datastore across multiple GAE apps using the Google App Engine Standard Environment Client Libraries. At least for python it's not possible, donno about go.

But the Cloud Datastore Client Libraries can be used to share a datastore across many apps, even from outside Google Cloud.

Regardless of the particular way the old app accesses the datastore (language/library/etc.) it can be configured from the Cloud Console to allow access to a remote app. The exact procedure steps are captured in https://stackoverflow.com/questions/42051453/how-do-i-use-google-datastore-for-my-web-app-which-is-not-hosted-in-google-app-e/42060551#42060551

The new app would be using the above-metioned client library with the old app's service account credentials (obtained in the above paragraph procedure) to access the old app's datastore.

huangapple
  • 本文由 发表于 2017年3月9日 23:18:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/42699003.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定