3 ms·
> where the fundamental problem is the tension between nicely structured primary keys that tend to improve spatial locality in the storage engine, and unique bu
by trollied 4y ago
> where the fundamental problem is the tension between nicely structured primary keys that tend to improve spatial locality in the storage engine, and unique but otherwise opaque identifiers that avoid running into Hyrum’s law when communicating with external entities and generally prevent unintentional information leakage.
I tend to use an integer for the database PK & internal associations, then an external_id that is used with external party data exchanges.