Django-nonrel vs Django-mongodb vs Mongokit vs pymongo native [英] Django-nonrel vs Django-mongodb vs Mongokit vs pymongo native

查看:126
本文介绍了Django-nonrel vs Django-mongodb vs Mongokit vs pymongo native的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

工作在需要NoSQL存储的Django项目中,我相信我已经定居在Mongo。我看过很多关于Mongo和Django的主题,但是没有一个提到Django-nonrel的话题,我看不出为什么它可能被取消资格,但是我没有任何经验。



理想情况下,我想为简单的东西,用户auth,组等保留SQL存储,并使用Mongo获取更大的数据。



我还希望将我的Mongo存储对象作为类,以Django-ORM风格,以便我可以有类似的感觉,但是不是关键



最后,上述任何一种都允许我使用Django的多数据库支持任何东西,或者是我所有的mongo查询都有效地从Django ORM带外 ?



如果还有其他因素,我可能很失望,可能很重要,请随便提示我,我在这个领域很少知道。

解决方案

Django-nonrel是在MongoDB上去Django的方式。有django-mongodb.org,但这只是建立在Django-nonrel之上的。在django-nonrel邮件列表中有相当多的mongodb活动。



将您的mongo类存储为Django ORM对象可以正常工作,这就是整点。 >

我没有尝试使用多数据库支持以及SQL。我没有看到很多人这样使用,我怀疑它很可能不起作用。有一些关于将django-nonrel移动到Django 1.4的官方部分的工作,我怀疑它将在完成之后工作。



使用django-nonrel for auth可以。主要问题是多对多的关系。 auth模块使用该对于每个用户对象权限 - 这不起作用。如果你不需要这些,你可能会在没有使用SQL的情况下离开。


Working on a Django project that requires a NoSQL store and I believe I've settled on Mongo. I've seen a lot of topics that talk about Mongo and Django, but none that mentioned Django-nonrel, and I can't see why it might have been disqualified, but I have no experience with any of them.

Ideally, I'd like to preserve the SQL store for the simple things, user auth, groups, etc., and use Mongo for the bigger data.

I'd also like to have my Mongo-stored objects as classes, in a Django-ORM style, so that I can have a similar 'feel', but that isn't critical.

Lastly, do any of the above allow me to use Django's multi-database support for anything, or are all my mongo queries effectively 'out of band' from the Django ORM?

If there are any other factors I'm missing that might be important, feel free to clue me in. I know little in this arena.

解决方案

Django-nonrel is the way to go for Django on MongoDB. There's django-mongodb.org, but that's just built on top of Django-nonrel. There's quite a bit of mongodb activity going on the django-nonrel mailing list.

Storing your mongo classes as Django ORM objects works fine, that's the whole point.

I haven't tried using the multi-database support along with SQL. I haven't seen many people use it like that, and I suspect it most likely does not work. There's some work on moving django-nonrel to be officially part of Django 1.4, I suspect it'll work after that's complete.

Using django-nonrel for auth works ok. The main problem is many-to-many relations. The auth module uses that for per user object permissions - that doesn't work. If you don't need that, you could probably get away without using the SQL at all.

这篇关于Django-nonrel vs Django-mongodb vs Mongokit vs pymongo native的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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