What's your opinion on using UUIDs as database row identifiers, particularly in web apps?

后端 未结 15 2124
深忆病人
深忆病人 2020-12-12 12:43

I\'ve always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object insta

15条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 13:36

    As long as you use a DB system with efficient storage, HDD is cheap these days anyway...

    I know GUID's can be a b*tch to work with some times and come with some query overhead however from a security perspective they are a savior.

    Thinking security by obscurity they fit well when forming obscure URI's and building normalised DB's with Table, Record and Column defined security you cant go wrong with GUID's, try doing that with integer based id's.

提交回复
热议问题