How I made my MongoDB based web app 10 times faster

21 October 2010   1 comment   Python, MongoDB

Powered by Fusion×

MongoKit is a Python wrapper on top of pymongo that adds structure and validation and some other bits and pieces. It's like an ORM but not for an SQL database but for a document store like MongoDB. It's a great piece of code because it's thin. It's very careful not to molly cuddle you and your access to the source. What I discovered was that I was doing an advanced query and with the results they we instantiated as class instances and later turned into JSON for the HTTP response. Bad idea. I don't need them to be objects really so with MongoKit it's possible to go straight to the source and that's what I did.

With few very simple changes I managed to make my restful API app almost 10 times faster!!

Read the whole story here


Hi Peter,

As a former fellow zopista myself also, I found myself at one point in need of a new python-based-web-framework fix, all this a couple of years back thinking that the seemingly natural continuation would undoubtedly be on to Djanjo, but I still needed something more pythonic, and found web2py, an excellent framework that in my opinion is the *true* progression from a Zope fellow, everything is python in web2py, including its own ORM, my last zope project,, was rewritten from scratch in web2py in a period of literally 3/4 weeks into, what a breath of fresh air this was, check it out whenever you have a chance, cheers, Julio
Thank you for posting a comment

Your email will never ever be published

Related posts

Why I gave up on JQuery UI's autocomplete 20 October 2010
In Django, how much faster is it to aggregate? 27 October 2010
Related by keywords:
Find song by lyrics 01 June 2004
From Postgres to JSON strings 12 November 2013
Fastest database for Tornado 09 October 2013
Gzip rules the world of optimization, often 09 August 2014
To JSON, Pickle or Marshal in Python 08 May 2009
Github Pull Request Triage tool 06 March 2014
Speed of DoneCal API (over 1,400 request/sec) and HTTPS (less than 100 request/sec) 27 December 2010
Migration of Postgres 9.2 to 9.3 with Homebrew and json_enhancements 30 April 2014
jsonpprint - a Python script to format JSON data nicely 21 November 2010
UPPER vs. ILIKE 19 April 2010
Migrating with South on a field that uses auto_now_add=True 16 December 2009
mongoengine vs. django-mongokit 24 May 2010