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

  • · 3 min read

    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.

    validation regex

  • · 4 min read

    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.

    uniqueness maths uuid v4

  • · 3 min read

    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.

    guid .net basics

  • · 3 min read

    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.

    javascript python java go sql

  • · 4 min read

    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.

    database keys postgresql mysql performance

  • · 4 min read

    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 versions rfc 9562

  • Featured · 4 min read

    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.

    uuid v4 uuid v7 database keys

  • · 4 min read

    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.

    basics uuid format

← All articles

↑ Top