Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I'm looking to generate unique ids for identifying some data in my system. </p> </blockquote> <p>I'd recommend a GUID then, since they are by definition <em>globally unique identifiers</em>.</p> <blockquote> <p>I'm using an elaborate system which concatenates some (non unique, relevant) meta-data with System.Guid.NewGuid(). Are there any drawbacks to this approach, or am I in the clear?</p> </blockquote> <p>Well, since we do not know what you would consider a drawback, it is hard to say. A number of possible drawbacks come to mind:</p> <ul> <li><p>GUIDs are big: 128 bits is a lot of bits. </p></li> <li><p>GUIDs are not guaranteed to have any particular distribution; it is perfectly legal for GUIDs to be generated sequentially, and it is perfectly legal for the to be distributed uniformly over their 124 bit space (128 bits minus the four bits that are the version number of course.) This can have serious impacts on database performance if the GUID is being used as a primary key on a database that is indexed into sorted order by the GUID; insertions are much more efficient if the new row always goes at the end. A uniformly distributed GUID will almost <em>never</em> be at the end.</p></li> <li><p>Version 4 GUIDs are pseudo-random but not cryptographically random; an attacker could in theory predict what your GUIDs are when given a representative sample of them. An attacker could in theory determine the probability that two GUIDs were generated in the same session. Version one GUIDs are of course barely random at all, and can tell the sophisticated reader when and where they were generated.</p></li> <li><p>And so on.</p></li> </ul> <p>I am planning a series of articles about these and other characteristics of GUIDs in the next couple of weeks; watch my blog for details.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload