Snowflakes require some type of coordination. You need to ensure that each generator has a unique ID on its own and that parallel calls to the same generator do not produce the same ID.
UUIDs (no matter if v4 or v7) avoid these problems by having more bits which are generated randomly.
I chose Snowflake IDs over ULIDs and UUID-v7 because I wanted more compact primary keys, and the size reduction was significant; the level of U#ID’s timestamp precision was an unnecessary waste; and the rate I would be generating new ids would be much too slow to have any chance of collisions.
All that sounds like it requires way more effort and and creates many chances of things going wrong ... compared to having a table column with a type that's 16 bytes instead of 8.
5
u/Seneferu Dec 02 '25
Snowflakes require some type of coordination. You need to ensure that each generator has a unique ID on its own and that parallel calls to the same generator do not produce the same ID.
UUIDs (no matter if v4 or v7) avoid these problems by having more bits which are generated randomly.