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

后端 未结 15 2184
深忆病人
深忆病人 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:20

    I work with a student management system which uses UUID's in the form of an integer. They have a table which hold the next unique ID.

    Although this is probably a good idea for an architectural point of view, it makes working with on a daily basis difficult. Sometimes there is a need to do bulk inserts and having a UUID makes this very difficult, usually requiring writing a cursor instead of a simple SELECT INTO statement.

提交回复
热议问题