Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19009 closed New feature (wontfix)

MongoDB

Reported by: mbaldwin@… Owned by: nobody
Component: Uncategorized Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Any plans to support Mongo or other non-relational databases? (Like Django-nonrel does: http://www.allbuttonspressed.com/projects/django-nonrel). I'd like to use Mongo because of its speed (not having to do joins and all) but if a web host supports Django it is less likely to be Django-nonrel.

Change History (3)

comment:1 by Alex Gaynor, 12 years ago

Resolution: wontfix
Status: newclosed

At present there is no effort going towards MongoDB support in the ORM, and I don't think there ever will be. At one point I put together a prototype demonstrating it was possible, but there are a number of fundamental incompatibilities that make me think it won't (and probably shouldn't) happen.

I'm wontfixing this since there really isn't any actionable item here.

comment:2 by anonymous, 12 years ago

I would like to get references as to why this is not a consideration. Adding support for MongoDB ORM at least at some level to expose in the Admin UI functionality is a crucial differentiator compared to other frameworks. Is this something we are aware of? What do we suggest to organizations that actively are working to incorporate MongoDB in production and use the Django framework?

comment:3 by Anssi Kääriäinen, 12 years ago

One of the biggest problems is that Django's in-built apps are designed for relational databases. The possibility that we could build a non-relational ORM that works with these apps with realistic amounts of data is pretty much zero.

In my opinion the best approach would be to build something that implements the Model API and the QuerySet API for those parts that make sense, but does so without trying to share too much code with SQL based models.

For example the sql/query.py is in large part dealing with SQL specific problems:

  1. Join creation, promotion (left or inner), and join reuse. (This is actually the source of most of complexity in the ORM)
  2. SQL's three-valued booleans: True, False and Unknown (that is, comparisons against NULL).
  3. Aggregation's where / having splits. ...

Now, if you try to force non-relational stuff into this, and then deal with all the problems they have to tackle, it is going to look ugly.

My understanding is that django-nonrel actually uses the sql/query.py, but they had to fork Django and things didn't turn out too rosy for that approach (Note: I really don't know too much about django-nonrel, so I might be completely off the track here).

All in all, it would be really great to have MongoDB or other similar databases with Django Model + QuerySet API so that you could write code using familiar APIs. But the idea that it is possible to have support for taking an existing non-trivial Django application, changing settings DB ENGINE to MongoDB and have it work is a no-go.

Note: See TracTickets for help on using tickets.
Back to Top