![]() Over time, it becomes the primary cause of performance issues. Only 5 entries of FK consume about 60 bytes to store only the GUID. Most of the primary keys are foreign keys in other tables.Consider a situation where a database is storing 10000 entries there, only GUID will occupy 160000 bytes. It allows you to know your primary key before a record is inserted.Easy to merge database between different machine,network etc.They really help in preventing data collisions.GUID produce by windows application can be used to identify particular file,application,component,databse entry. In programming whenever we create a interface or method it is given an unique id which will be used to invoke them. ![]() ![]() Where are GUIDs used?Ĭonsider an distibuted system where many programmer are working independently and generating ID, in this senario it is possible that two programmer generate common ID and at time of merging it will create problem so we must use GUID when we have multiple independent system or user who are generating ID which must be unique. A common approach is to create an auto-incrementing integer another way would be to create a GUID for your products. We may store users or products in our database and want somehow to uniquely identify each row in the database. For an application using 10 billion random GUIDs, the probability of a coincidence is approximately 1 in a quintillion.( 1030) While each generated GUID is not guaranteed to be unique, the total number of unique keys (3.40282366×1038) is so large that the probability of the same number being generated twice is very small. A GUID makes a great primary key in the back-end database. we use GUID because it have very low probability of being duplicated as it is 128-bit integer(16 bytes) which allow to use GUID across all databse and computer without data collision. Now a question arise if we already have primary key than why we use Globally Unique Identifier(GUID). UUID stands for Universally Unique Identifier.
0 Comments
Leave a Reply. |