Using guid or database sequence?

  • Thread starter Thread starter muscha
  • Start date Start date
M

muscha

Hi,

I'm trying to decide whether I should use Guid.NewGuid() to generate an ID
or using database sequence. Is Guid.NewGuid() will return a unique number?
The MSDN said that the probability of duplication is low, but how low? Does
anyone know?

thanks,

/m
 
Hi muscha,

Unbelievably low - in fact low enough to basically be ignored. It is hard to
comprehend how large 128 bit integers actually are.

HTH,
 
Unbelievably low - in fact low enough to basically be ignored. It is hard
to
comprehend how large 128 bit integers actually are.

So is this a good practice? To use Guid as my ID generator?

thanks,

/m
 
I believe that duplications are not even possible, as long as you have a network card on the computer.
From what I understand, Guid's are generated based on the network card mac address as well as System ticks..
 
Robert Jeppesen said:
I believe that duplications are not even possible, as long as you have a network card on the computer.
From what I understand, Guid's are generated based on the network card mac
address as well as System ticks..

So .. no two computer should ever generate the same Guid yes? I am working
in multiple box setup and the uniqueness of the Guid is critical. This is
why we are thinking of using database sequence for the guarantee.

thanks,

/m
 
Back
Top