开发者

Are GUIDs the ultimate ID?

开发者 https://www.devze.com 2022-12-28 18:41 出处:网络
开发者_Go百科I noticed some people don\'t bother having the usual incremented number as ID but instead simply generate a GUID. The advantages include:
开发者_Go百科

I noticed some people don't bother having the usual incremented number as ID but instead simply generate a GUID. The advantages include:

  • Quick and easy
  • No need to keep track of previous IDs
  • Guaranteed to be unique even across machines without knowledge of each other

Some disadvantages are:

  • Possibly performance bottleneck
  • Uses a large number of bytes

My understanding is that using a GUID is beneficial in most cases, except if optimization for time or space is an issue. Did I miss something? Or do you agree with this idea?


A couple of cons:

  • Pain in the neck if you have to delve into anything manually (debuggin etc). They are completely unreadable.
  • Horrible if you ever need to pass them in a URL
0

精彩评论

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

关注公众号