App Engine:NDB和数据存储之间的区别 [英] App Engine: Difference between NDB and Datastore

查看:171
本文介绍了App Engine:NDB和数据存储之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


$ b $ ol <$>
  • NDB数据存储

  • 数据库数据库

  • 两个配额限制(免费)似乎都是相同的,太。但NDB自动缓存Memcache中的数据!



    我真的想知道何时使用哪种存储?这方面的一般做法是什么?

    我可以完全依赖NDB而忽略数据库吗?应该怎么做?



    我一直在使用Django并阅读了Django-nonrel中的JOIN操作可以在NDB中以某种方式完成!并在数据库中使用其余的存储空间!这是为什么?这两个存储都是无模式的,并且很好地使用相同的设计。那么,有人可以调整NDB中的JOIN而不是DB中的数据?

    >简而言之,这些是数据存储的两个版本。 db是旧版本,而ndb是新版本。不同之处在于模型,在数据存储中这些都是一样的东西。 NDB提供了诸如处理缓存(memcache)本身的优点。而ndb比db快。所以你一定要去ndb。使用ndb数据存储时,只需在定义模型时使用ndb.Model


    I have been going through the Google App Engine documentation (Python) now and found two different types of storage.

    1. NDB Datastore
    2. DB Datastore

    Both quota limits (free) seem to be same, and their database design too. However NDB automatically cache data in Memcache!

    I am actually wondering when to use which storage? What are the general practices regarding this?

    Can I completely rely on NDB and ignore DB? How should it be done?

    I have been using Django for a while and read that in Django-nonrel the JOIN operations can be somehow done in NDB! and rest of the storage is used in DB! Why is that? Both storages are schemaless and pretty well use same design.. How is that someone can tweak JOIN in NDB and not in DB?

    解决方案

    In simple words these are two versions of datastore . db being the older version and ndb the newer one. The difference is in the models, in the datastore these are the same thing. NDB provides advantages like handling caching (memcache) itself. and ndb is faster than db. so you should definitely go with ndb. to use ndb datastore just use ndb.Model while defining your models

    这篇关于App Engine:NDB和数据存储之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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