The Wild World of Unique Identifiers (UUID, ULID, etc)

Kyle Carter
Geek Culture
Published in
13 min readAug 18, 2021

--

Photo by Maksym Kaharlytskyi on Unsplash

Every once in a while as a developer you find yourself stepping, and falling, into a much deeper rabbit hole than you would expect. I recently had one of these experiences as I have dug into the world of unique identifiers. It is this rabbit hole that I would like to take you down for a bit as well. Unique identifiers are everywhere in our code and our data storage and through better understanding what they are and the trade-offs between them we can make more educated decisions in our day-to-day work.

Where we began:

Historically a lot of software has used incrementing numbers to represent the identifier of a particular piece of data. They can be auto-generated by many data stores, they are easy to reason about, are efficient to store and sort, are naturally time ordered, and can be easy to say (ex: “Hey Marsha, can you take a look at record 3162?”). It is for many of these reasons that the industry used these identifiers for so long.

That being said, there are also downsides to using incrementing numbers as identifiers especially as we start working in “web-scale” applications. Due to the sequential nature of data you often aren’t able to generate these identifiers concurrently. You could use techniques like skipping so many values for each generation and having different starting points…

--

--

Kyle Carter
Geek Culture

I'm a software architect that has a passion for software design and sharing with those around me.