opaque ids vs. natural keys

Ian Booth ian.booth at canonical.com
Wed May 29 06:00:22 UTC 2013


> However, where I'm more concerned is the overloading of semantics onto
> the primary key of the machine document in mongo.  To me it just feels
> wrong, and Ian also has this feeling, although stronger than me.
> 
>

Yeah, I've previously been bitten hard by this issue so it tends to raise a red
flag with me when I see it being done. It can be very much a religious argument
I agree. But given how likely it is we may not get the natural keys defined 100%
correctly the first time (eg for machines, the namespace representing the
containment heirarchy), or may need to change the key definition as Juju
evolves, and the issues surrounding schema upgrades that would entail, plus all
the other reasons for preferring surrogate keys, my vote is very firmly +1 to
using them.


> I can see the desire for having natural keys that we show the user, but
> history has shown (over and over) that having opaque unique ids provides
> a better identity story.
>

Having natural keys that the user sees and opaque, surrogate keys for DB
identity are not mutually exclusive :-)




More information about the Juju-dev mailing list