A UUID (Universally Unique Identifier) is a 128-bit label used for information in computer systems. It is a 36-character alphanumeric string that can be used to identify information, such as rows of data within a database table, with each row assigned a specific UUID. UUIDs are generated using an algorithm based on a timestamp and other factors such as the network address, and they are constructed in a sequence of digits equal to 128 bits. UUIDs are standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE) and are documented as part of ISO/IEC 11578:1996 "Information technology – Open Systems Interconnection – Remote Procedure Call (RPC)".
When generated according to the standard methods, UUIDs are, for practical purposes, unique. Their uniqueness does not depend on a central registration authority or coordination between the parties generating them, unlike most other numbering schemes. While the probability that a UUID will be duplicated is not zero, it is generally considered close enough to zero to be negligible. UUIDs are widely used in part because they are highly likely to be unique globally, meaning that not only is a rows UUID unique in a database table, but its probably the only row with that UUID in any system anywhere.
UUIDs are generally used for identifying information that needs to be unique within a system or network thereof, such as associative keys in databases and identifiers for physical hardware within an organization. UUIDs can identify databases, system instances, primary keys, Bluetooth profiles, or objects with short lifetimes. UUIDs are commonly used as a unique key in database tables, and they solve problems that traditional approaches to unique IDs, such as generating random IDs with SERIAL, can cause in distributed systems.
There are five different versions of UUIDs, excluding the Nil UUID version, which is a special case UUID where all its bytes are set to 0, and most contain some variants that allow for special cases specific to vendors like Microsoft. Version 1 and 2 use time-based sources (a 60-bit timestamp sourced from the system clock) for its randomness. The UUID relies upon a combination of components to ensure uniqueness. A UUID contains a reference to the network address of the host that generated the UUID, a timestamp, and a randomly generated component.