45
Views
4
Comments
Solved
what are the benefits of using Guid as the primary key over the long integer for an e

what are the benefits of using Guid as the primary key(Entity ID) over the long integer for an entity?

2024-05-22 06-12-56
Vignesh Prakash
Solution

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.

2023-12-11 06-54-51
Deepali Nayak
Solution

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.

2024-05-22 06-12-56
Vignesh Prakash
Solution

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.

2021-11-12 04-59-31
Manikandan Sambasivam

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

UserImage.jpg
Lavanya A

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 

2023-12-11 06-54-51
Deepali Nayak
Solution

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.