Marina Levit said:
I would argue that the odds of generating the same GUID on 2 different
clients is so small, that it shouldn't be a consideration. Realistically,
it's just not going to happen, although yes, it's not 100% guaranteed.
The chance of any two GUIDs being equal are practically zero.
The chance of the one new GUID colliding in a database with millions (or
more) of records is still incredibly small.
The chance of any one of a million new GUIDs colliding with millions of
existing records, is getting to be enough to worry about, to the point where
I suspect SQL specifically checks for collision and generates a new GUID.
http://en.wikipedia.org/wiki/Birthday_paradox
True, GUIDs are 128-bits, and if you needed to add 2^32 records, you'd only
have 2^63 possible collisions, leaving you with a 2^-64 chance of collision.
But some of the bits in the GUID aren't random but tied to the specific
hardware (usually MAC address) in order to guarantee that different
workstations don't collide. So your chance of collision is now on the order
of 2^-20, or one-in-a-million. Obviously the number of records is very
important.