UUID guides
The background behind our UUID generator. What a UUID is, how the versions differ, whether they can collide, and how to use them as database keys.
8 articles, newest first
-
How to Validate a UUID with Regex, Plus Why You Might Not Want To
A correct regular expression for UUID validation, with variants for specific versions, braces and uppercase, and the built in parsers that are usually a better choice.
-
Can Two UUIDs Collide? The Math Behind Uniqueness
How likely is a UUID v4 collision really? We work through the birthday problem with real numbers so you can stop worrying, and cover the rare ways collisions actually happen.
-
UUID vs GUID: Is There Any Difference?
GUID is Microsoft's name for a UUID. They are the same 128 bit format, with one byte order quirk in .NET and SQL Server that can bite you.
-
How to Generate a UUID in JavaScript, Python, Go, Java, C# and SQL
Copy and paste snippets for generating UUID v4 and v7 in JavaScript, Node, Python, Go, Java, C#, PostgreSQL, MySQL and the command line.
-
Should You Use UUIDs as Database Primary Keys?
The real trade offs of UUID primary keys in PostgreSQL and MySQL: storage size, index fragmentation, security, and why UUID v7 changes the answer.
-
All UUID Versions Explained: v1 to v8
A tour of every UUID version defined in RFC 9562. What each one encodes, how to recognise it from the version digit, and which ones are still worth using.
-
UUID v4 vs v7: Which One Should You Use?
UUID v4 is random, UUID v7 is time ordered. See how each is built, how they affect database indexes, and a simple rule for picking one.
-
What Is a UUID? A Plain English Guide
Learn what a UUID is, what the 36 character format means, how UUIDs stay unique without a central server, and when you should use one.