Rule Mongo with an Iron Fist

At we’ve been using MongoDB on various projects for the last six months or so. We finally re-factored out our MongoDB related code and created a new library. It’s battle tested on the project pages of, and it’s getting a workout in my new project (no details on that yet).

250px-Max_von_Sydow-Ming_the_MercilessOne thing we learned is that you have to enforce some stuff on the Python side of the world in order to make working with totally schema free data stores easier.

So, just like in Flash Gordan, we’ve got Ming to rule Mongo.

Rick’s blogged about it at length here:

And all I can say, is that I’m very happy with Ming as it is now, and it’s meeting our needs quite well. We are of course open to suggestions, and we’re hoping that we can open up more stuff as we go.

If you want to see the details, they can be found on the (of course) site:

If you’re looking for a larger exampel of Ming in actin Chris Perkins (coding machine that he is) and some other TurboGears devs are already looking at building a content management system with Ming and tg2:

If you use Ming, and like it, feel free to let us know.

2 Responses to “Rule Mongo with an Iron Fist”

  1. I learned about Ming after reading Rick’s blog post the other day and it looks great. Just wondering if you’ve thought about whether similar concepts could be applied to async (like Twisted, etc.) connections to MongoDB. It looks like this would be pretty tricky to do with something like Ming, since it seems to handle things similarly to how SQLALchemy does things.

    How much magic is there in the session handling in Ming?

  2. Well, mongoDB’s built in abstraction is more like a traditional DB, you have connections which are long lived, and cursors and all of that.

    But MongoDB does provide for some simple async use cases like throwing data at the DB and not waiting for a response.

    As for the session handling magic in Ming, there’s really not much at all over the top of what mongo-python provides in terms of connection/cursor handling.

    The entirety of the ming session code can be found here:;a=blob_plain;f=ming/;hb=HEAD

Comments are currently closed.