]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add notes on loading strategies for ORM relationships
authorarmando-migliaccio <armamig@gmail.com>
Sat, 19 Dec 2015 00:34:21 +0000 (16:34 -0800)
committerarmando-migliaccio <armamig@gmail.com>
Sat, 19 Dec 2015 00:34:21 +0000 (16:34 -0800)
There have been a number of regressions caused by our inability
to thoroughly review relatiohships' loading strategies. We should
at least make an attempt to remind ourselves, and since I am guilty
as charged, this patch is my attempt to redemption.

Change-Id: I879cfceaa51386e9d6c683e7e02487df92b7e290

doc/source/devref/effective_neutron.rst

index bbe918189ec3bb1ae5361323caab2946c47b56f9..13c9bd8300b111a8bab8cffacccdbc91c5c33d11 100644 (file)
@@ -104,6 +104,10 @@ Document common pitfalls as well as good practices done during database developm
   transaction blocks, and the innermost block raises an error without proper
   rollback. Consider if `savepoints <http://docs.sqlalchemy.org/en/rel_1_0/orm/session_transaction.html#using-savepoint>`_
   can fit your use case.
+* When designing data models that are related to each other, be careful to how
+  you model the relationships' loading `strategy <http://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html#using-loader-strategies-lazy-loading-eager-loading>`_. For instance a joined relationship can
+  be very efficient over others (some examples include `router gateways <https://review.openstack.org/#/c/88665/>`_
+  or `network availability zones <https://review.openstack.org/#/c/257086/>`_).
 
 System development
 ~~~~~~~~~~~~~~~~~~