App Engine 上云数据存储的客户端库 - NDB 或 google-cloud-datastore
Client Library for Cloud Datastore on App Engine - NDB or google-cloud-datastore
根据 Google 的文档,似乎我有两个使用 Python 连接到数据存储的主要选项:App Engine 的 NDB 数据存储库和 Google 云数据存储 API 对于 Python.
我目前使用的是 App Engine(标准版),但我想构建我的应用程序,以便在需要时可以超越它,可能是通过迁移到 Compute Engine。考虑到这一点,我应该使用哪个库? App Engine 的文档指出可以使用 NDB,但似乎不再积极开发它了。在撰写本文时,最后一次提交是在 6 个多月前,尽管看起来它们之前可能是 planning some expansion。一切最终会转而使用 Google Cloud Datastore API 吗?如果 NDB 被逐步淘汰,我真的不想对它产生依赖性。
我还没有尝试过,但似乎在 App Engine may come with its own issues.
中使用了完整的 Google Cloud Datastore API
如果有人有在 App Engine - 标准版上使用 Google 云数据存储区 API 的经验,我很乐意听取您的想法。
编辑 - 2016-11-30 - 唯一性
此问题被标记为与 相似。虽然有一些相似之处,但我特别提到希望选择一种能够在 App Engine 之外轻松增长的解决方案。在这一点上,我假设 NDB 库只适用于 App Engine,所以如果我超越 App Engine,它就不会工作。但是,我认识到在 App Engine 上使用 NDB 可能仍然有优势,然后如果我超出范围,则交换到 Cloud Datastore API。我提出的一些相关的、更具体的问题包括:
- NDB 和 Cloud Datastore API 是否足够相似以至于以后从一个转移到另一个不会有那么大的问题?也许有人这样做过,可能会有意见。
- NDB 真正在 App Engine 上大放异彩有什么具体原因吗?性能?
- 由于 NDB 使用 Cloud Datastore,我是否应该担心它最终会停用? Google 最近让 App Engine 越来越接近云计算阵容的其余部分,而 NDB 存储库最近没有看到很多更新这一事实让我担心。 Google 确实会时不时地停产。
谢谢。
阅读更多内容后,我将继续回答我自己的问题,希望对其他人有所帮助。
完整阅读 discussion on google-cloud-python 后,我的许多问题都可以得到一定程度的回答。
首先,开发者对该项目的意见似乎是Google Cloud Datastore API should work on App Engine, but that the performance will be worse than NDB。这当然是在 App Engine 上使用 NDB 而不是 Datastore API 的原因。
其次,听起来开发人员认为 NDB 既复杂又相当成熟,似乎一致支持 its eventual inclusion in the Cloud Datastore python library。因此,NDB 似乎不太可能停产。最有可能的是,它可能最终需要从更广泛的 gcloud 库集中包含进来。
第三,开发者表示 NDB support beyond App Engine is being actively developed, so if my project moves beyond App Engine, NDB may already be available on further environments by then, so no switch to the Cloud Datastore API will be required. Besides, the next step beyond standard App Engine is the Flexible Environment, which seems to already support NDB nicely。
所有这些都是为了说明我应该清楚地继续使用 NDB,受益于它在 App Engine 上更好的性能和 ORM 功能,除非 Google 的 opinions/directions 在这个问题上有所改变将来,我很可能会选择在 Google 云上的其他环境中继续使用 NDB。我打算使用 NDB 并期待它最终被纳入 google-cloud-python.
如果有人对此事有任何其他经验,我很想听听您的想法。
根据 Google 的文档,似乎我有两个使用 Python 连接到数据存储的主要选项:App Engine 的 NDB 数据存储库和 Google 云数据存储 API 对于 Python.
我目前使用的是 App Engine(标准版),但我想构建我的应用程序,以便在需要时可以超越它,可能是通过迁移到 Compute Engine。考虑到这一点,我应该使用哪个库? App Engine 的文档指出可以使用 NDB,但似乎不再积极开发它了。在撰写本文时,最后一次提交是在 6 个多月前,尽管看起来它们之前可能是 planning some expansion。一切最终会转而使用 Google Cloud Datastore API 吗?如果 NDB 被逐步淘汰,我真的不想对它产生依赖性。
我还没有尝试过,但似乎在 App Engine may come with its own issues.
中使用了完整的 Google Cloud Datastore API如果有人有在 App Engine - 标准版上使用 Google 云数据存储区 API 的经验,我很乐意听取您的想法。
编辑 - 2016-11-30 - 唯一性
此问题被标记为与
- NDB 和 Cloud Datastore API 是否足够相似以至于以后从一个转移到另一个不会有那么大的问题?也许有人这样做过,可能会有意见。
- NDB 真正在 App Engine 上大放异彩有什么具体原因吗?性能?
- 由于 NDB 使用 Cloud Datastore,我是否应该担心它最终会停用? Google 最近让 App Engine 越来越接近云计算阵容的其余部分,而 NDB 存储库最近没有看到很多更新这一事实让我担心。 Google 确实会时不时地停产。
谢谢。
阅读更多内容后,我将继续回答我自己的问题,希望对其他人有所帮助。
完整阅读 discussion on google-cloud-python 后,我的许多问题都可以得到一定程度的回答。
首先,开发者对该项目的意见似乎是Google Cloud Datastore API should work on App Engine, but that the performance will be worse than NDB。这当然是在 App Engine 上使用 NDB 而不是 Datastore API 的原因。
其次,听起来开发人员认为 NDB 既复杂又相当成熟,似乎一致支持 its eventual inclusion in the Cloud Datastore python library。因此,NDB 似乎不太可能停产。最有可能的是,它可能最终需要从更广泛的 gcloud 库集中包含进来。
第三,开发者表示 NDB support beyond App Engine is being actively developed, so if my project moves beyond App Engine, NDB may already be available on further environments by then, so no switch to the Cloud Datastore API will be required. Besides, the next step beyond standard App Engine is the Flexible Environment, which seems to already support NDB nicely。
所有这些都是为了说明我应该清楚地继续使用 NDB,受益于它在 App Engine 上更好的性能和 ORM 功能,除非 Google 的 opinions/directions 在这个问题上有所改变将来,我很可能会选择在 Google 云上的其他环境中继续使用 NDB。我打算使用 NDB 并期待它最终被纳入 google-cloud-python.
如果有人对此事有任何其他经验,我很想听听您的想法。