[openstack-dev] Db interaction: conductor vs objects vs apis

Russell Bryant rbryant at redhat.com
Tue Feb 18 19:40:13 UTC 2014


On 02/18/2014 01:22 PM, Pitucha, Stanislaw Izaak wrote:
> Hi all,
> I'm writing some new code which uses objects sent around by rpc. I got to
> implementing some new conductor methods and started wondering... what's the
> current recommended way of interacting with the database? Many seem to be
> around:
> - "fat model" approach - put the db interaction in objects
> - put the db interactions in the conductor itself
> - completely separate it (quotas style)
> 
> Since the new code isn't that big or generalized in any way, I'm dropping
> the third option completely. But conductor -vs- object stays.
> What should do the db calls? If it's objects, should I also do that even for
> things that would take only one line in conductor/manager?

It may be easier to provide a better answer with more details on what
you're doing, but the general answer is use objects always.

-- 
Russell Bryant



More information about the OpenStack-dev mailing list