10

MySQL 主键用自增好还是 UUID、雪花算法 ID 好?用自增+UUID 会不会好一点?

 4 years ago
source link: https://www.v2ex.com/t/792708
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

MySQL 主键用自增好还是 UUID、雪花算法 ID 好?用自增+UUID 会不会好一点?

  polyang · 7 小时 21 分钟前 · 1225 次点击
我想的是一个表有两个基本字段 id 和 primary_key,id 是自增,且为主键; primary_key 为 UUID,是逻辑主键,表与表之间通过 primary_key 来关联,对前端也只暴露 primary_key 。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK