python: All content tagged as python in NoSQL databases and polyglot persistence
I prefer the manner of declaring field types in MongoEngine to MongoKit, but that’s just me. If you’re coming from something like the Django ORM, MongoEngine is very similar.
If you need to make on-the-fly modifications to document schemas at runtime, MongoKit is the way to go. MongoKit also allows you to bypass validation.
Finally, compare the MongoKit and MongoEngine documentation. I find the MongoEngine documentation a much more useful reference (it’s easier to navigate and read — very much my opinion though):
While I’m not a very experienced Pythonista, nor have I used any of these libraries, I must confess that I’m finding both being too much inspired from ORMs. There is structure in document databases, but enforcing all the rules and strictness of a relational model seems a bit too restrictive. Plus, it is unclear on how you can actually take advantage of document databases schemaless when using these libraries.
Tornado, the non-blocking web server and tools open sourced by FriendFeed before their acquisition, seems to get some NoSQL activity. While Django is leading the way in the Python world, judging by the NoSQL projects happening around Node.js, one could say that Tornado, with its non-blocking architecture, may be an interesting alternative.
Thomas Pelletier has ☞ a blog post about a simple websocket + Tornado + Redis Pub/Sub protocol integration:
The principle is very simple: when your user loads the page, she is automatically added to a list of “listeners”. An independent thread is running: it listens for messages from Redis with the subscribe command, and send a message through Websocket to every registered ”listener”. In this example, the user can send a message to herself with a simple AJAX-powered form, which calls a view with a payload (the message), and the view publish it via the publish command of Redis.
This is basically a web chat! If you want to have fun, you can then add a roster, with a presence system, authentication etc…
There’s also a ☞ GitHub project called Trombi:
Trombi is an asynchronous CouchDB client for Tornado.
And I’m pretty sure there are other projects I’ve missed (but you can leave a comment to add them to the list).
Keep in mind that Redis-backed queues is one very often cited use case for Redis.
Original title and link for this post: Presentation: RestMQ - HTTP/Redis based Message Queue (published on the NoSQL blog: myNoSQL)
Firstly, Diarmuid Bourke’s presentation at PyCon Irland 2010:
Mike Dirolf ☞ covers the details of working with PyMongo and replica sets, one of the most interesting features in the MongoDB 1.6 releases:
PyMongo makes working with replica sets easy. Here we’ll launch a new replica set and show how to handle both initialization and normal connections with PyMongo.
And in case you’d like to learn some more you can also check:
Django decided long time ago that Ruby on Rails cannot be the only framework where people can have fun integrating with all NoSQL databases. During this year DjangoCon Europe there were several session dedicated to Django and NoSQL databases:
- Alex Gaynor: What NoSQL support in the Django ORM looks like, and how do we get there
- Peter Bengtsson: Using MongoDB in your app
- Benoît Chesneau: Relax your project with CouchDB
- Tobias Ivarsson: Django and Neo4j: Domain Modeling that Kicks Ass
- Django and NoSQL Panel
What NoSQL support in the Django ORM looks like, and how do we get there
Alex Gaynor speaks about what needs to change in Django ORM to make it more NoSQL friendly:
Reinout van Rees has a summary of the talk ☞ here.
Using MongoDB in your app
Peter Bengtsson talks about his experience of passing from using ZODB for the last 10 years to MongoDB
Some notes from the talk are available ☞ here.
Relax your project with CouchDB
Benoît Chesneau talks about what makes CouchDB appealing to python developers. He also covers the CouchDBkit python framework.
Django and Neo4j: Domain Modeling that Kicks Ass
Not coming from DjangoCon, but still about Django and Neo4j, is Tobias Ivarsson’s presentation: “Django and Neo4j - Domain modeling that kicks ass”:
Derek Stainer summarizes the slide deck ☞ here.
Django and NoSQL Panel
All in all a lot of NoSQL excitement in the Django world! Or should it be the opposite?
Update: Here is the latest Django and NoSQL Databases status update