Tuesday, March 26, 2013

Re: Is there a plan for Django to handle NoSQL databases natively?


On Wed, Mar 27, 2013 at 12:10 AM, Donnie Darko <gittestdev@gmail.com> wrote:

I really like Django. I've fiddled around a bit with Rails, but I personally prefer Django's logic. I also prefer Python over Ruby. Again, personal preferences. Despite all that, I am now switching back to Rails because of Django's lack of native support for databases like mongodb. I saw there was no plan for Django 1.5 to support NoSQL databases.

I've tried to install django-nonrel as it looked promising, but with no success. Even if I succeeded, I can't trust this fork of django considering the lack of active development. There isn't even a post to tell you what version of the dependencies to install, some of which are updating quite fast. So you run into errors that are not well-documented, and it's just an horror.

Django could be a long term investement for me, so I was wondering if there there was a plan to change Django's ORM to support NoSQL databases?

Are there any active plans to change the ORM? No.

Have we thought about it? Yes. A couple of years back, we had a Summer of Code project to add NoSQL support to the ORM. This got to the point of having a proof of concept implementation that worked -- but there were also some technical problems that were never resolved, and as a result the branch was never merged.

Django-nonrel was always an unofficial fork. AFAIK, the original developer is no longer maintaining the project; I'm not aware if someone else has picked up the maintenance burden.

However - it's not all gloom and doom. 

Firstly, you can still use NoSQL data stores in a Django app - you just don't get anything to do with Models. Django is Python, so if there's a Python API for MongoDB, you can call that API in you Django view code. You can still use Forms (but not ModelForms), URL routing, and many other parts of Django - you just can't use anything that depends on Models.

Secondly, there's one approach to NoSQL that hasn't been investigated at all that might yield a result -- duck typing. This is Python, and in most cases the API doesn't care if you *actually* have a Django model - it just needs to quack like one -- and depending on your needs, it may not be that hard to construct an object that quacks enough like a Django model to use it with ModelForms or Admin. This sort of API wrapper is something that could be developed externally to the Django project -- again, as long as your wrapper quacks the right way, it should be possible to make it compatible.

Yours,
Russ Magee %-)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment