The Ultimate Guide to UUIDs
A Universally Unique Identifier (UUID) is a 128-bit label used for information in computer systems. Unlike traditional incremental IDs, UUIDs can be generated independently without a central authority, making them essential for distributed systems, microservices, and modern web applications.
Deep Dive into UUID Versions
UUID v1
Learn More →Generated using the current timestamp and the node (MAC address). Useful for knowing exactly when an ID was created.
UUID v4
Learn More →The most common version, generated using cryptographically strong random numbers. Collision risk is astronomically low.
UUID v7
Learn More →The modern standard for databases. Time-sortable, which significantly improves indexing performance (B-tree friendliness).
UUID v5
Learn More →Deterministic IDs generated by hashing a Namespace and a Name together. Perfect for consistent mapping.
When to use which UUID?
General Purpose
Use v4 for unique identifiers where sortability isn't required.
Databases
Use v7 for primary keys to maintain high performance during inserts and lookups.
Consistent Mapping
Use v5 when you need to generate the same ID consistently from the same input data.