Support for No-SQL database in Django

181 views
Skip to first unread message

Vineet Sharma

unread,
Nov 29, 2020, 12:29:43 PM11/29/20
to Django developers (Contributions to Django itself)
Hello everyone,
I am Vineet Sharma and am very new to contributing to Django. I have made a few projects on Django and Django Rest framework.Now, I would really love to contribute to Django and be a part of the community. I may also be participating in GSOC in future for the same.

I want to work on integrating Django with No-SQL databases officially. There are a few packages that does the work, for integrating the same, but they are not official by the community and have a lots of bugs in getting the work done. Being honest, my friends chose NodeJs (or other frameworks) over Django due to support for MongoDB via mongoose, saying that Django still works with SQL databases, but in my view, working in Django is way more comfortable, secure and easy to manage server-side framework. I would love to integrate No-SQL database integration into Django, in the same manner the SQL database is integrated via Django ORM.

I would request to you all to help me in building the same, or would love to work with the team that's working on the same. Please guide me where to start from.

Thanks & Regards
Vineet Sharma



Adam Johnson

unread,
Nov 30, 2020, 4:28:04 AM11/30/20
to django-d...@googlegroups.com
Hi Vineet

This topic comes up occasionally. See here for the last time: https://groups.google.com/g/django-developers/c/NxRX4nHx2Vk/m/MRouYivAAQAJ

Quoting Aymeric from that post:

Support for MongoDB would mean support in the ORM. The R in ORM stands for Relational. MongoDB isn't a relational database. Therefore "support" for MongoDB would be deceptive. The consensus is for not adding it. I'm not aware of changes in MongoDB or in Django that could result in a different outcome if the discussion happens again.

If you'd like to push this proposal forwards anyway, writing a DEP would be the next step. Be aware that it will be difficult to get it accepted.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/667ba403-f446-465e-8839-c51dab9c4158n%40googlegroups.com.


--
Adam

Vineet Sharma

unread,
Nov 30, 2020, 5:57:41 AM11/30/20
to Django developers (Contributions to Django itself)
Hello,

I read the conversation you linked, and do agree with them, since ORM is used for Relational Databases. Since there is a package named pymongo for connecting to mongodb, which does the exact work we want to do, we can work on integrating pymongo with django on the internal levels, since the users are shifting from SQL to NoSQL database and so we should.

It will take a lot of work to do, but it would be a great initiative for the developers to manage , edit and update their database, stored in a local mongoDB database via the admin portal, as is the current case for SQL.

Thanks & Regards
Vineet Sharma

Jacob Rief

unread,
Dec 4, 2020, 6:58:25 PM12/4/20
to Django developers (Contributions to Django itself)
Hello Vineet,
you can perfectly use MongoDB together with Django. In fact I do that in one of my projects and where I use it, it perfectly makes sense.

The question you raised is, if the Django community can adopt the ORM for non-relational databases, such as MongoDB. I would say
no, for the same reasons as explained by Aymeric.

Now ask yourself why you want that.
Do you need aggregations, database functions, joins with filtering on foreign keys, etc.? Then you should consider a relational database anyway.
Or would you just like to define models and have the Django admin generate some nice editors for your non relational data-model?
If the latter is the case, then that's a valid point! In fact, maybe the Django admin should provide hooks for extension, in order to add list- and
detail-views, not handled by the Django-ORM-to-Django-Admin mapper.

Just my two cents ...

– Jacob

Vineet Sharma

unread,
Dec 5, 2020, 9:24:13 AM12/5/20
to Django developers (Contributions to Django itself)
Hello Jacob,
Yes, the latter case you discussed is what I wanted. All I wanted was to have the same functionality as is there in SQL for NoSQL, and adding support for it in the admin section too.

Thank You

Vineet Sharma

Jacob Rief

unread,
Dec 6, 2020, 3:47:34 AM12/6/20
to django-d...@googlegroups.com
Do you need aggregations, database functions, joins with filtering on foreign keys, etc.? Then you should consider a relational database anyway.
Or would you just like to define models and have the Django admin generate some nice editors for your non relational data-model?
If the latter is the case, then that's a valid point! In fact, maybe the Django admin should provide hooks for extension, in order to add list- and detail-views, not handled by the Django-ORM-to-Django-Admin mapper.
 
Yes, the latter case you discussed is what I wanted. All I wanted was to have the same functionality as is there in SQL for NoSQL, and adding support for it in the admin section too

Then maybe you should propose to add the possibility for adding List- and Detail-Views to the Django-Admin without an underlying Django-Model. You could then
just use a normal Django Form and use it to edit your MongoDB model.

Adam Johnson

unread,
Dec 6, 2020, 4:39:49 AM12/6/20
to django-d...@googlegroups.com
Aaron Bassett is a DSF member and also works at MongoDB. I just listened to his recent Django Chat podcast episode ( https://djangochat.com/episodes/mongodb-aaron-bassett ) in which he said anyone interested in MongoDB support for Django should message him on twitter or email him. He wants to get a team started on this at MongoDB. So feel free to contact him: https://twitter.com/aaronbassett
 
Then maybe you should propose to add the possibility for adding List- and Detail-Views to the Django-Admin without an underlying Django-Model.

I believe this is technically already possible, as long as you provide an object that follows the model meta api ( https://docs.djangoproject.com/en/3.1/ref/models/meta/ ). I think djangae already does so: https://pypi.org/project/djangae/ . But probably building such an adaptor is really a lot of work.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.


--
Adam
Reply all
Reply to author
Forward
0 new messages