Why is better to use an UUID to store unique id val开发者_JAVA百科ues? What are the benefits?
Two reasons.
A regular ID is only unique within your table inside of your system. If you ever need to integrate systems there is going to be conflict. UUID is guaranteed to be unique across systems.
A second reason is often you don't want people to know how many records you have in your system. If you have an id with 1,2,3,4,5,6,ect someone can easily figure out how big or small your system is.
精彩评论