Guide Developer Basics

What Is a UUID and When Should You Use One?

Learn why UUIDs are useful for distributed identifiers, the trade-offs versus sequential IDs, and why a UUID is not an access-control mechanism.

2 min readUpdated September 22, 2026

A UUID is a 128-bit identifier designed to be unique without requiring one central counter. The familiar text form uses hexadecimal groups separated by hyphens, such as 550e8400-e29b-41d4-a716-446655440000.

Why distributed systems use UUIDs

Two offline devices, services, or databases can generate identifiers independently. With random UUIDs, they do not need to ask one central server for “the next number” before creating a record.

Version 4 UUIDs

UUID v4 uses random bits while reserving specific bits for the version and variant. A cryptographically strong random source makes accidental collisions extraordinarily unlikely for normal application workloads.

When sequential IDs are still useful

Simple integers are compact, easy to read, and index efficiently. They can be a better choice for internal database keys where one database controls ID creation and exposing the sequence is not a concern.

Do not use obscurity as authorization

A UUID in a URL can be difficult to guess, but it should not be the only thing protecting private data. The application should still check whether the authenticated user has permission to access the requested object.

Indexing and storage considerations

Storing UUIDs as 36-character text is convenient but larger than storing the underlying 16 bytes. Random insertion order can also affect some database indexes. High-scale systems sometimes choose ordered UUID variants or different identifier schemes for that reason.

Common use cases

  • Public API object IDs
  • Offline-created records
  • Event IDs
  • Import/export workflows
  • Identifiers generated by multiple services