what are the benefits of using Guid as the primary key(Entity ID) over the long integer for an entity?
Hi @Priya Naveen,
Good Day!!!!
I believe the below document might help you to understand better.
https://jmjames.medium.com/using-guids-as-entity-identifiers-in-outsystems-f9ae5d2d28d8
Thanks,Vignesh Prakash.
Hi @Priya Naveen,This is a very good question,we are using GUID in many projects as identifiers.
Here are few listed advantages and disadvantages listed:
Advantages:
Global Uniqueness: The “GU” in “GUID” stands for Globally Unique. This makes GUIDs perfect for distributed systems where uniqueness across multiple databases or instances is a priority.
Smooth Merges: Merging records from different databases or tables? GUIDs as primary keys make this task a breeze.
Enhanced Security: GUIDs, being non-sequential and unpredictable, add an extra layer of security, especially useful if you’re wary of users predicting ID sequences.
Disadvantages:
Performance Hits: Compared to integers, GUIDs can be a tad slower to index and search. If not used judiciously, they can lead to database fragmentation.
Not So Human-Friendly: With their length and complexity, GUIDs are harder to remember, type out, or work with manually.
Bulky Size: Occupying 16 bytes, GUIDs are bulkier than both int and long.
Using GUIDs as the primary key promotes loose coupling, making it more advantageous when joining OutSystems entities with external databases. also, GUIDs will be more seamless when merging of data from different applications without conflicts. Unlike sequential long integer IDs, GUIDs are also less predictable, enhancing security
Hi @Priya Naveen, Depends on the Scenario you can use Guid or long integer(auto number) as a Entity Identifier. In outsystems when you are passing Screen Input Parameter as longinteger its auto generated so can easily track the next Entity details. but if it a Guid its a Unique one that couldn't be easily tracked. and identifier is unique so combine more sources of data does not have any possibility match for entity identifier. for more Details refer this discussion i hope this might help