GUIDs, UUIDs and the Need for Unique Identifiers
From PiRho Knowledgebase
Jump to navigationJump to search
Summary: Globally Unique Identifiers (GUIDs) and Universally Unique Identifiers (UUIDs) provide a mechanism for uniquely identifying objects, records, and resources across systems without requiring a central authority.
Context
Almost every computer system needs a way to uniquely identify things.
- Users
- Documents
- Orders
- Projects
- Devices
- Events
- Database records
What is a UUID?
UUID stands for:
Universally Unique Identifier
A UUID is a 128-bit identifier designed to uniquely identify an object.
What is a GUID?
GUID stands for:
Globally Unique Identifier
GUID is Microsoft's terminology for a UUID.
In modern systems, a Microsoft GUID is typically a UUID Version 4.
GUID ≈ UUID v4
UUID Versions
UUID Version 4
Advantages:
- Simple
- Widely supported
- Difficult to predict
Disadvantages:
- Not time ordered
- Can fragment indexes
UUID Version 7
Advantages:
- Time ordered
- Database friendly
- Efficient indexing
Disadvantages:
- Approximate creation times can be inferred
Conclusion
GUIDs and UUIDs solve the problem of uniquely identifying objects without central coordination.