UUID v4 โ the default everywhere. 122 random bits; collisions are not a practical concern.
UUID v7 โ same shape, but the first 48 bits are a millisecond timestamp, so rows sort by creation time and database indexes stay compact. Prefer it for new primary keys.
ULID โ 26-character Crockford base32, also time-sortable, no hyphens, case-insensitive.
NanoID โ 21 URL-safe characters with the same collision resistance as UUID v4 but shorter.
Short ID โ 8 characters from a 32-letter alphabet (โ40 bits). Fine for coupon codes and share links, not for security tokens.