Sample Header Ad - 728x90

What are the drawbacks with using UUID or GUID as a primary key?

75 votes
3 answers
44135 views
I would like to build a distributed system. I need to store data in databases and it would be helpful to use an UUID or a GUID as a primary key on some tables. I assume it's a drawbacks with this design since the UUID/GUID is quite large and they are almost random. The alternative is to use an auto-incremented INT or LONG. What are the drawbacks with using UUID or GUID as a primary key for my tables? I will probably use Derby/JavaDB (on the clients) and PostgreSQL (on the server) as DBMS.
Asked by Jonas (33975 rep)
Jan 6, 2011, 02:21 AM
Last activity: Dec 22, 2023, 04:24 PM