TLDR · PROGRAMMING, DESIGN & DATA SCIENCE

I LOVE UUID, I HATE UUID

blog.epsiolabs.com6 min read

Summary from the TLDR newsletter

UUIDv4 is simply a random number in a 122bit spectrum. UUIDv7 uses its first 48 bits for the current time stamp, a few more bits for version and variant, and 74 bits to store a random number. This means that consecutive generations of UUIDv7s will sort one after the other. This solves the index issue and makes it possible to know the insert time of a row from within the primary key, which helps with debugging.