When are you truly forced to use UUID as part of the design?

前端 未结 16 886
盖世英雄少女心
盖世英雄少女心 2020-11-28 17:39

I don\'t really see the point of UUID. I know the probability of a collision is effectively nil, but effectively nil is not even close to impossible.

16条回答
  •  感动是毒
    2020-11-28 18:14

    A classic example is when you are replicating between two databases.

    DB(A) inserts a record with int ID 10 and at the same time DB(B) creates a a record with in ID 10. This is a collision.

    With UUIDs this will not happen as they will not match. (almost certainly)

提交回复
热议问题