Log in / create account | Login with OpenID
DocForge
An Open Wiki For Software Developers

UUID

From DocForge

A UUID, or Universal Unique Identifier, is a type of GUID standardized by The Open Group in 1997[1] and by an RFC in 2005[2]. A UUID is a number that is almost guaranteed to be globally unique across all computer systems.

A UUID is a 128-bit number represented by a string of five hexadecimal numbers - "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx": [3]

  • The first three numbers are generated from a timestamp.
  • The fourth number preserves temporal uniqueness in case the timestamp value loses monotonicity (for example, due to daylight saving time).
  • The fifth number is an IEEE 802 node number that provides spatial uniqueness. Typically the MAC address of an Ethernet card or some other hardware address is used. In some systems a random number is substituted if a node number is not available, in which case spatial uniqueness cannot be guaranteed. The probably of a collision is very low even without this spacial uniqueness.

Contents

Benefits [edit]

  • As a standard, UUIDs can easily be used in diverse systems which need to share information. The Remote Procedure Call standard for which it was created is a prime example.
  • UUIDs can be generated without the need to check for collisions.

Drawbacks [edit]

  • Systems without a unique hardware node address will typically use a random number as a substitute, increasing the chance of collision.
  • The large value can be a detriment to database system performance. If a smaller unique number, such as a 32-bit integer, can be used within a local database system, it's generally preferable for performance.[4]

Implementations [edit]

Uses [edit]

  • The subversion revision control system uses UUIDs to uniquely identify repositories.

See Also [edit]

Notes [edit]

  1. “DCE 1.1: Remote Procedure Call” (Appendix A) CAE (Common Applications Environment) Specifications (Document Number C706)
  2. RFC 4122
  3. MySQL 5.0 Reference Manual - 11.10.4 Miscellaneous Functions
  4. MySQL Performance Blog: To UUID or not to UUID?