[openstack-dev] [Glance] Replacing Glance DB code to Oslo DB code.

Joshua Harlow harlowja at yahoo-inc.com
Mon Aug 19 04:56:56 UTC 2013

Another good article from an ex-coworker that keeps on making more and more sense the more projects I get into...


Your mileage/opinion though may vary :)

Sent from my really tiny device...

On Aug 18, 2013, at 8:12 PM, "Robert Collins" <robertc at robertcollins.net<mailto:robertc at robertcollins.net>> wrote:

On 19 August 2013 14:22, Jay Pipes <jaypipes at gmail.com<mailto:jaypipes at gmail.com>> wrote:

I'm completely with Joshua here - the ORM layer is more often than not
a source of bugs and performance issues.

If used improperly, yep.


There is no proper use of an ORM.

We don't use the SQLAlchemy ORM for cross-SQL-DB support - thats a
lower layer. It's the model objects themselves that we use the ORM
for, and we could use SQLAlchemy's lower layers but not the ORM.

Hmmm, not quite... see below.

An alternative I think would be better would be to scrap the use of
the SQLAlchemy ORM; keep using the DB engine abstraction support.

Just keep in mind that the Session and Query objects and their related APIs
are in the SQLAlchemy ORM, not the SQLAlchemy Core.

Ok, so either it's not a bright line, or we'd need to have an
alternative thing - not just a reimplementation either, cause that's

But sure, ok.

But then I guarantee somebody is gonna spend a bunch of time writing an
object-oriented API to the model objects because the ORM is very useful for
the data modification part of the DB interaction.

!cite - seriously...

Because people will complain about having to do this:

conn = engine.connection()
# instances is the sqlalchemy Table object for instances
inst_ins = instances.insert().values(blah=blah)
ip_ins = fixed_ips.insert().values(blah=blah)

This strawman is one way that it might be written. Given that a
growing set of our projects have non-SQL backends, this doesn't look
like the obvious way to phrase it to me.

instead of this:

i = Instance(blah=blah)
ip = FixedIp(blah=blah)

And so you've thrown the baby out with the bathwater and made more work for

Perhaps; or perhaps we've avoided a raft of death-by-thousand-cuts
bugs across the project.


Robert Collins <rbtcollins at hp.com<mailto:rbtcollins at hp.com>>
Distinguished Technologist
HP Converged Cloud

OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org<mailto:OpenStack-dev at lists.openstack.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130819/881db185/attachment.html>

More information about the OpenStack-dev mailing list