v4 or v7 - the choice actually matters
A v4 UUID is 122 random bits. That is exactly what you want for anything that must be unguessable: a share link, a password-reset token, an identifier exposed to the public. It is also exactly what you do not want as a database primary key, because consecutive inserts land in random positions of the index, so each one dirties a different page and the hot part of the index never stays in cache. On a large, write-heavy table that is measurable write amplification rather than a theoretical concern.
A v7 UUID, standardised in RFC 9562 in 2024, puts a 48-bit millisecond timestamp in the high bits and fills the rest with randomness. Values therefore sort by creation time and inserts append to the end of the index, which is the behaviour you wanted from an auto-increment column without the coordination an auto-increment column needs. The trade is that a v7 leaks its creation time, so it is the wrong choice wherever v4's unguessability was the point.
- v4 for tokens, share links and any public identifier
- v7 for primary keys, event ids and anything sorted by time
- Nil and Max for sentinel values and range bounds
- Uppercase, braces and hyphen-free variants for .NET and char(32) columns