← Back to team overview

nova team mailing list archive

Re: Moving away from SQLAlchemy models? What?



This comment was with regards to using declarative_base(), which was used to quickly implement the data layer and save some time.  The next iteration we've been discussing internally, is to drop the use of declarative_base and using sqlalchemy table definitions instead.  

declarative_base() provides value primarily when you are planning on actually using sqlalchemy models as the middle tier.  We only use them as a stepping stone in the data layer, and then treat everything as dicts currently.  (Whether we should be using dicts everywhere is part of a larger discussion I hope to bring up at the next design summit.)  

By using the table definitions directly and bypassing declarative_base(), we will be able to cut out two superfluous and unnecessary transformations before the data is passed back to the middle tier.

There are no immediate plans to do this, but you are right - it is worthy of further discussion.


This only was meant to indicate that we would be changing from u

On Oct 2, 2010, at 2:52 AM, Soren Hansen wrote:

> Looking at the commit message for r316 on trunk, I see this (emphasis mine):
>    Also refactored NovaBase and removed several methods since they
>    would have to be changed *when we move away from sqlalchemy models*
>    and begin using sqlalchemy table definitions.
> I find it worrisome that such things are stated as though they are
> naturally given or generally agreed upon. I have no recollection of a
> discussion to that effect, let alone a decision.
> I certainly hope a big patch to do this doesn't suddenly turn up without
> prior discussion and a related blueprint..
> -- 
> Soren Hansen
> Ubuntu Developer    http://www.ubuntu.com/
> OpenStack Developer http://www.openstack.org/
> _______________________________________________
> Mailing list: https://launchpad.net/~nova
> Post to     : nova@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~nova
> More help   : https://help.launchpad.net/ListHelp

Follow ups