GUID 是最终 ID 吗?
我注意到有些人不打算使用通常的递增数字作为 ID,而是简单地生成 GUID。优点包括:
- 快速、简单
- 不需要跟踪以前的 ID
- 即使在彼此不了解的情况下,也能保证在不同的机器上都是唯一的
一些缺点是:
- 可能的性能瓶颈
- 使用大量字节
我的理解是,使用 GUID 在以下方面是有益的:大多数情况下,除非时间或空间优化是一个问题。我错过了什么吗?或者你同意这个想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一些缺点:
A couple of cons: