【问题标题】:Using datastore of appengine 1 for appengine 2将 appengine 1 的数据存储用于 appengine 2
【发布时间】:2020-05-10 08:22:20
【问题描述】:

随着 Python 2 即将结束,App Engine 1 不再受支持,我们正在迁移到 App Engine 2。我有一个相当大的数据存储区。鉴于两个 App Engine 需要在两个不同的项目上,是否可以连接到旧 App Engine 的数据存储区作为新 App Engine 的数据存储区?理想情况下使用 NDB。

【问题讨论】:

  • Given that the two App Engines need to be on two different projects -- 我很确定情况并非如此。见第 3 点here
  • 谢谢@gaefan。不知道。

标签: google-app-engine google-cloud-platform app-engine-ndb google-app-engine-python


【解决方案1】:

可以从另一个项目中的应用访问 GAE/GCP 项目的数据存储区,甚至可以从 Google Cloud 外部访问,请参阅 How do I use Google datastore for my web app which is NOT hosted in google app engine?

我还没有玩过python 3 ndb library(又名 Cloud NDB),我不能确切地说它是否/如何使用另一个项目的凭据。不过,我不确定您是否想尝试使用它:来自Migrating to Cloud NDB

Cloud NDB 旨在替换 App Engine NDB 中的功能,因此它 在 Datastore 模式下将不支持 Firestore 的新功能。新的 Python 3 应用程序应使用Datastore mode client library 而不是 Cloud NDB。

在最坏的情况下,Datastore 模式客户端库(实际上是 Python 3 GAE 应用程序的推荐库)应该能够访问您的 Python 2 应用程序的数据存储区 - 它是通用的,可用于任何应用程序,而不仅仅是 GAE。根据文档,其Client() 方法支持指定项目和凭据(您将在其中使用python 2 应用程序项目的服务帐户)。可能感兴趣:GCP-The App Engine APIs are not available, with py 3

【讨论】:

猜你喜欢
  • 2010-11-12
  • 1970-01-01
  • 2014-04-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多