Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an "opaque" key?

Tags:

database

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

like image 441
Kjensen Avatar asked May 01 '09 19:05

Kjensen


2 Answers

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.

like image 164
Jon Skeet Avatar answered Nov 05 '22 20:11

Jon Skeet


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'.

like image 37
chaos Avatar answered Nov 05 '22 20:11

chaos