Tutorial :What is an “opaque” key?



Question:

I know what a key is, I know what opaque is in other contexts - but what is an opaque key in a database context?


Solution:1

It means it has no real meaning beyond being used to look up records - it should just be treated as arbitrary data, for no purpose other than keying. This almost always applies to GUIDs, for example. Compare this with situations where the primary key might be a social security number.

These are also known as surrogate (opaque) vs natural keys.


Solution:2

Something like a GUID that doesn't tell you anything about unrelated rows or external information, as opposed to things like serial PKs and user-significant information like email addresses that tell you something beyond 'this is a key'.


Solution:3

Here's a little bit of the master on that subject. Much, much more in his books. :)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »