Reputation: 2797
What are advantages and disadvantages of UUID field?
When should I use it as a primary key? When should I use default primary key?
My table has many rows. Is it possible that max value of default primary key will be exceeded?
I use PostgreSQL.
Upvotes: 3
Views: 890
Reputation: 11
Primary Key -
It is an auto-increment unique key which is created by database engine when we create a new record each time to the table.
UUID -
It is unique too but it is unique in "the whole universe", not guaranteed unique but practically unique. Like when we want create a ticket based environment to solve customer issues then we must generate a ticket_id by UUID(because its unique and it is combination of random numbers).
If you want to go deep into it then check this awesome blog here
Upvotes: 1