google.appengine.ext.ndb和gcloud.datastore有什么区别? [英] what's the difference between google.appengine.ext.ndb and gcloud.datastore?

本文介绍了google.appengine.ext.ndb和gcloud.datastore有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ndb :(从google.appengine.ext导入ndb)



数据存储区:(从gcloud导入数据存储区)



有什么区别?我已经看到他们都使用了,并暗示他们都将数据保存到谷歌数据存储。为什么会有两种不同的实现?

解决方案

Python NDB Client特定于在Google App Engine上运行的Python应用程序。数据存储客户端删除该限制,您可以在任何地方运行Python应用程序,包括Google App Engine,Google Compute Engine或其他任何地方。

Exceprt表单 - https: //cloud.google.com/appengine/docs/python/ndb/


Google数据存储区NDB客户端库允许 App Engine Python
应用程序连接到云数据存储


另外,NDB客户端某些功能(例如缓存),而另一个功能不支持。

ndb: (from google.appengine.ext import ndb)

datastore: (from gcloud import datastore)

What's the difference? I've seen both of them used, and hints they both save data to google datastore. Why are there two different implementations?

解决方案

The Python NDB Client is specific to Python Applications running on Google App Engine. The datastore client removes that restriction and you can run your Python application anywhere, including Google App Engine, Google Compute Engine or anywhere else.

Exceprt form - https://cloud.google.com/appengine/docs/python/ndb/

The Google Datastore NDB Client Library allows App Engine Python apps to connect to Cloud Datastore.

In addition, the NDB client has certain features (e.g. caching) while the other does not appeat to support.

这篇关于google.appengine.ext.ndb和gcloud.datastore有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆