UUID Versions Explained
Version 4 (Random)
The most common type. Generated using cryptographically strong random numbers. Ideal for temporary tokens, session IDs, or when sort order doesn't matter.
Version 7 (Sortable)
Includes a timestamp. This allows databases (like PostgreSQL) to index them efficiently because they are sequential. Ideal for Primary Keys (PKs).