[openstack-dev] [nova] FKs in the DB
Clint Byrum
clint at fewbar.com
Fri Nov 20 21:43:40 UTC 2015
Excerpts from Matt Riedemann's message of 2015-11-20 10:58:55 -0800:
>
> On 11/20/2015 10:19 AM, Alexis Lee wrote:
> > We just had a fun discussion in IRC about whether foreign keys are evil.
> > Initially I thought this was crazy but mordred made some good points. To
> > paraphrase, that if you have a scale-out app already it's easier to
> > manage integrity in your app than scale-out your persistence layer.
> >
> > Currently the Nova DB has quite a lot of FKs but not on every relation.
> > One example of a missing FK is between Instance.uuid and
> > BandwidthUsageCache.uuid.
> >
> > Should we drive one way or the other, or just put up with mixed-mode?
>
> For the record, I hate the mixed mode.
>
> >
> > What should be the policy for new relations?
>
> I prefer consistency, so if we're adding new relationships I'd prefer to
> see that they have foreign keys.
>
If FedEx preferred consistency over efficiency, then they'd only just
now be able to exist due to drones being available. Otherwise they'd
have to have had a way to cover the last mile of delivery using some
sort of air travel, to remain consistent.
What I'm saying is, sometimes you need a recommissioned 727 to carry
your package, and sometimes you need a truck. Likewise, there are times
when de-normalization is called for. As I said in my other reply to Mr.
Bayer, we don't really know that this is that time, because we aren't
measuring. However, if it seems like a close call when speculating,
then it is probably prudent to remain consistent with most other things
in the system.
More information about the OpenStack-dev
mailing list