Understanding UUID & GUID Versions
A Universally Unique Identifier (UUID) is a 128-bit label used for database primary keys, session identification, transaction tracking, and file identifiers. Microsoft refers to this standard as a Globally Unique Identifier (GUID).
Differences Between v4, v7, and v1
- UUID v4: Constructed fully out of cryptographically strong random values. This is the most common UUID form.
- UUID v7: Incorporates a Unix millisecond timestamp at the beginning, followed by random entropy. This time-ordering makes it highly optimized for relational databases (like PostgreSQL, MySQL) to prevent index fragmentation.
- UUID v1: Generated from the exact host computer system timestamp and physical MAC node.