Google 云数据存储和 w/o 协议缓冲区

Google Cloud Datastore with and w/o Protocol Buffers

在搜索有关 Google Cloud Datastore 的信息时,我偶然发现了两个不同的官方文档分支,它们在概念方面似乎具有相同的内容,但提供的代码示例基于两个不同的 APIs:

  1. Here 示例基于 Protocol Buffers API。
  2. Here基于标准Google App Engine SDK 提供相同内容和示例。

似乎 API 都支持同一组操作,但我无法弄清楚两者之间的实质区别是什么。为什么我应该选择一个而不是另一个,为什么 Google 提供两者?

不同之处在于您的应用程序 运行。 Datastore 最初只是 App Engine 的东西,具有特定于 App Engine 的 API,后来扩展为支持从其他来源访问。

如果您要部署到 Google App Engine,请选择 #2。

如果您要在其他地方部署,并希望使用 Google Cloud Datastore 作为您的存储库,请选择 #1。