✨ UUIDv7 is the modern standard for database primary keys. Because the first 48 bits encode current Unix time, UUIDv7 preserves chronological index locality in Postgres, MySQL, and SQLite without B-tree page fragmentation.
Sanctum fully supports the updated IETF RFC 9562 specification for Universally Unique IDentifiers:
- UUIDv4: 122 bits of cryptographically secure random entropy via
crypto.getRandomValues. - UUIDv7: Millisecond-precision Unix epoch timestamp + 74 bits of entropy. Naturally sortable.
- UUIDv1 / v6: Gregorian 100-nanosecond tick timestamp since Oct 15, 1582.