mongoengine vs. django-mongokit

24 May 2010   3 comments   Python, Django

Mind that age!

This blog post is 10 years old! Most likely, its content is outdated. Especially if it's technical.

django-mongokit is the project you want to use if you want to connect your Django project to your MongoDB database via the pymongo Python wrapper. An alternative (dare I say competing alternative) is MongoEngine which is bridge between Django and straight to pymongo. The immediate difference you notice is the syntax. django-mongokit looks like MongoKit syntax and MongoEngine looks like Django ORM. They both accomplish pretty much the same thing. So, which one is fastest?

First of all, remember this? where I showed how django-mongokit sped past the SQL ORM like a lightning bullet. Well appears MongoEngine is even faster.

mongoengine vs. django-mongokit

That's an average of 23% faster for all three operations!


Nicolas Clairon


Can you provide the script source you used for this benchmark ? What version of MongoKit did you used ? I'd like to see what can I do to improve MongoKit speed.


Peter Bengtsson

It's tucked away in a branch of django-mongokit but I haven't put the branch online. I can just send you a zip of the whole damn project and hopefully you can just run it and find out what can be optimized more. Interested?

Unfortunately upgrading to the latest version of MongoKit that doesn't generate indexes every time didn't help. MongoEngine is still faster.

Alberto Paro

I've used both, but there approach are not django.
If you want use a django implementation of mongodb give a look to the performance are the same of mongoengine if you the mongodb manager. But you work in the django way.

Your email will never ever be published

Related posts

More on What is "pythonic" 22 May 2010
"Using MongoDB in your Django app - implications and benefits" 25 May 2010
Related by Keyword:
Fastest database for Tornado 09 October 2013
django-mongokit now compatible with Django 1.4 11 August 2012
Persistent caching with fire-and-forget updates 14 December 2011
Optimization story involving something silly I call "dict+" 13 June 2011
Mocking DBRefs in Mongoose and nodeunit 14 April 2011