Add notes on loading strategies for ORM relationships

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
This commit is contained in:
armando-migliaccio 2015-12-18 16:34:21 -08:00
parent 495f8c606e
commit fce62cf424

View 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
~~~~~~~~~~~~~~~~~~