On 17 déc. 2013, at 20:38, Karen Tracey <[email protected]> wrote:

> https://groups.google.com/d/msg/django-developers/0IuJssTt8tc/TxdXQ2D0thcJ

Interesting. Now I remember reading that message last year. I have three 
reactions.

First, Russell and I agree that the interest has faded. Currently, the best 
option is (probably) django-nonrel. We're open to suggestions that help 
django-nonrel but we aren't working towards a merge.

Second, Russell talks about the ORM API, not about the ORM code. He implies is 
that little code, if any, would be shared between the relational and the 
non-relational backends. We agree again.

Third, his examples conveniently ignore relations, which is where both 
relational databases and Django’s ORM shine. That’s where I disagree. Here’s an 
interesting example (extracted from a real project):

(Subscription.objects
    .valid_for_reporting()
    .filter(inception_date__gte=self.start_dt, inception_date__lt=self.end_dt)
    .annotate(rentals_count=Count('subscriber__rentals'))
    .annotate(rentals_duration=Sum('subscriber__rentals__dn_duration'))
    .annotate(rentals_distance=Sum('subscriber__rentals__dn_distance'))
    
.annotate(rentals_net_amount=Sum('subscriber__rentals__pricing__net_amount'))
    
.annotate(rentals_vouchers_net_amount=Sum('subscriber__rentals__pricing__voucher_details__net_amount'))
    .order_by('inception_date')
    .values(...)
)

I have some doubts about the practicality of running such a query on an NoSQL 
datastore or translating it automatically to a map-reduce job.

So, while it’s technically possible to implement parts of the ORM’s APIs on top 
of a non-relational database — as proved by the django-nonrel project — there 
isn’t much enthusiasm because the APIs are optimized for joins, which SQL 
databases are good at while NoSQL storage engines aren’t.



-- 
Aymeric.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4FF76EE8-F7FF-4947-82E1-6DE2BC420A8D%40polytechnique.org.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to