google.appengine.ext.ndb 和 gcloud.datastore 有什么区别?
what's the difference between google.appengine.ext.ndb and gcloud.datastore?
ndb:(来自 google.appengine.ext 导入 ndb)
数据存储:(来自 gcloud 导入数据存储)
有什么区别?我已经看到它们都被使用,并提示它们都将数据保存到 google 数据存储区。为什么会有两种不同的实现方式?
Python NDB 客户端特定于 Python 应用程序 运行 在 Google App Engine 上。数据存储客户端删除了该限制,您可以在任何地方 运行 您的 Python 应用程序,包括 Google App Engine、Google Compute Engine 或其他任何地方。
例外形式 - https://cloud.google.com/appengine/docs/python/ndb/
The Google Datastore NDB Client Library allows App Engine Python
apps to connect to Cloud Datastore.
另外,NDB客户端有一些功能(如缓存),其他的不支持。
这两种实现的原因是,最初,Datastore(称为 App Engine Datastore)只能从 App Engine 内部使用(通过私有 RPC API)。在 Python,访问此 API 的唯一方法是通过类似 ORM 的库 (NDB)。正如您在导入中看到的那样,它是 App Engine API.
的一部分
现在 Google 已通过名为 Cloud Datastore API 的 restful API 使 Datastore 在 App Engine 之外可用。 gcloud library 是一个客户端库,允许从 Google Cloud 访问不同的 rest APIs,包括 Cloud Datastore API.
ndb:(来自 google.appengine.ext 导入 ndb)
数据存储:(来自 gcloud 导入数据存储)
有什么区别?我已经看到它们都被使用,并提示它们都将数据保存到 google 数据存储区。为什么会有两种不同的实现方式?
Python NDB 客户端特定于 Python 应用程序 运行 在 Google App Engine 上。数据存储客户端删除了该限制,您可以在任何地方 运行 您的 Python 应用程序,包括 Google App Engine、Google Compute Engine 或其他任何地方。
例外形式 - https://cloud.google.com/appengine/docs/python/ndb/
The Google Datastore NDB Client Library allows App Engine Python apps to connect to Cloud Datastore.
另外,NDB客户端有一些功能(如缓存),其他的不支持。
这两种实现的原因是,最初,Datastore(称为 App Engine Datastore)只能从 App Engine 内部使用(通过私有 RPC API)。在 Python,访问此 API 的唯一方法是通过类似 ORM 的库 (NDB)。正如您在导入中看到的那样,它是 App Engine API.
的一部分现在 Google 已通过名为 Cloud Datastore API 的 restful API 使 Datastore 在 App Engine 之外可用。 gcloud library 是一个客户端库,允许从 Google Cloud 访问不同的 rest APIs,包括 Cloud Datastore API.