Tevfikcagri

Primary Key Alternatives

Discussion created by Tevfikcagri on Feb 27, 2018

This subject has been discussed in many posts before but my intention is to discuss use cases and what kind of solutions has been developed.

 

Integration of ArcGIS with a third party application. There seem to be four alternatives for "primary key" to set up a relation without creating relationship classes. OBJECTID, GLOBALID, GUID and an integer field.

The least stable is OBJECTID. As it's pretty hard to preserve the values. And also it's not suggested in the technical documents.1

 

The second option is GLOBALID which is suggested by Esri and seems to be most used.2 However, there are some possibilities of change on GLOBALID values.3 Besides, in an ArcGIS blog post, it's not recommended to use them as unique identifiers.4 I know that this post is a bit old but, I couldn't find any newer information to replace it.

 

GUID seems to be the strongest option as they never change in any data transfer scenario. Plus, this option is suggested in the same blog post for unique identifiers. What we need to do is create a structure of sequence-triggers to generate the values. This option is also suggested in Alternative to ObjectID as Primary Key for Related Tables by Vince Angelo. As he mentioned GUID's can cause performance issues on joins.

 

So here comes the latest option. Creating an integer field. If I'm going to create sequences and triggers what GUID type will provide me rather than an integer type?

 

 

1: “No, it is not recommended to use ObjectIDs when joining a table in ArcMap.” https://support.esri.com/en/technical-article/000012462 

2: " Developers can use them in relationships or in any application requiring globally unique identifiers." - http://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/arcgis-field-data-types.htm#GUID-97064FAE-B42E-4DC3-A5C9-9A6F12D053A8 

3: https://support.esri.com/en/technical-article/000010889 

4: "This should not be used for a Unique ID. These values can change if you have to reload the data at some point or if you drop the Global ID field and re-add it. " https://blogs.esri.com/esri/arcgis/2009/09/28/guids-as-ids/ 

Outcomes