UUIDv4 is pure random (128 bits, no structure). UUIDv7 is timestamp-prefixed (48-bit Unix ms + 74 bits random). Practical difference: v7 is lexically sortable (later timestamps sort later); v4 is not. This matters for database primary keys — v4 causes random inserts across B-tree indexes, fragmenting and slowing down; v7 inserts are append-mostly and much faster. Both have 122+ bits of randomness so collision probability is vanishing for either. New projects: use v7. Legacy compatibility: v4 remains widely supported. Generate v4 or v7 with the UUID generator.
All questions