Caching MongoDB connections in Django -
i'm using standard (as opposed nonrel) version of django connected postgresql on top of apache + mod_wsgi. setup connects mongodb (some data saved externally). right have create new mongodb connection each django request, , pass along throughout call stack functions require access mongodb. there way cache connections between requests?
edit
at risk of blasphemy, global variable work in case?
there several ways explaining how pymongo can work (or fail) mod_wsgi, suggested here: http://api.mongodb.org/python/current/faq.html?highlight=wsgi#does-pymongo-work-with-mod-wsgi
in addition can use kind of pooling solution, described here: http://www.mongodb.org/display/docs/notes+on+pooling+for+mongo+drivers
one project know have pooling mongoengine, simple orm uses pymongo behind scenes. might want pymongo faq solutions above.
Comments
Post a Comment