On Sat, Jan 16, 2010 at 10:35 PM, [email protected] <[email protected]> wrote: > I'm not really a developer on Django itself, but I am fairly > interested in non-relational databases, and some of the things being > said in this thread worry me a bit.
OK, if you read my mail literally I sound like "all" nonrel DBs are the same. Of course they're not and you can find a counter-example for almost everything. There's nothing to worry about, though. The counter-examples simply need additional changes to get supported. It's not like my changes would prevent other backends. >> 1. Nonrel DBs don't distinguish between INSERT and UPDATE >> On such DBs Model.save_base() shouldn't check if an entity already >> exists. Instead, it should just always INSERT. For this I added >> connection.features.distinguishes_insert_from_update. > > That's not entirely true. Riak and CouchDB are two that come to mind > instantly as explicitly distinguishing between insert and update (in > Riak an update includes the vector clock information from a previous > read, and in CouchDB they can be mapped to different HTTP verbs). Yes, CouchDB is versioned, so an UPDATE operation is useful. OTOH, many other nonrel DBs (SimpleDB, MongoDB, GAE, ...) wouldn't distinguish between INSERT and UPDATE on a save(). >> 2. Deleting related objects can be too costly on non-relational DBs >> For this I added >> connection.features.supports_deleting_related_objects. If it's False >> no related objects will be deleted. Ideally, the backend should be >> able to delegate this job to a background task. This is planned. > > Again, this seems like a GAE-specific observation. In Redis, for > example, related objects can be stored in a list data structure, and > the delete operation can be passed any number or keys, so it could be > a very minimal set of operations to delete related objects (first read > the list of related object keys, then delete them in bulk). Cassandra > also has support coming for batch deletion, at which point efficient > related object deletion will be similarly trivial. GAE and many other nonrel DBs have batch deletes, but I don't think that we should delete several thousands of entities that way in a single request. This will take too long - unless you want to make your users wait a few seconds for the result. > I think these efforts are great--a lot of people want to get up and > running on GAE with Django, and it's not so easy right now. It just > worries me a bit that the description of the effort encompasses all of > non-relational databases when the implementation seems to primarily > reason around GAE. It makes sense to concretely pick one database and > start there, otherwise no work would ever be finished, but I think > that the better thing to do is to call it GAE support instead of > nonrel support. We have people interested in adding MongoDB, CouchDB, and maybe SimpleDB support. The current code should be abstract enough for SimpleDB and probably also MongoDB (though, it would help to modify AutoField to also support string values). Other DBs might need additional changes, but that's what the "nonrel" project is for. Everyone can join and work on Django changes needed for their DB. Bye, Waldemar Kornewald -- http://twitter.com/wkornewald http://bitbucket.org/wkornewald/ http://allbuttonspressed.blogspot.com/
-- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
