Joon
Joon

Reputation: 9914

UUID or GUID in database as a primary key. when should I use it and when should I not use it?

I am designing the database for social web site.

should I consider using UUID or GUID for primary key at all?

or should I not worry about it until the site gains significant number of users, and it's not too late to worry about it then?

Upvotes: 0

Views: 663

Answers (1)

Oded
Oded

Reputation: 499392

GUID/UUID is ideal in disconnected scenarios where you have disconnected clients and need to reintegrate inserted data from them.

In other situation, they have a large overhead compared with the more traditional auto incremented integer.

As you say, worry about running out of integer ids closer to the date when it matters ;)

Upvotes: 1

Related Questions