开发者

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

开发者 https://www.devze.com 2023-02-25 02:32 出处:网络
I am designing the database for social web site. should I consider using UUID or GUID for primary key at all?

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, a开发者_开发知识库nd it's not too late to worry about it then?


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 ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消