Hacker News new | past | comments | ask | show | jobs | submit login

Isn’t that exactly what the NEWSEQUENTIALID function was created for?

https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequ...




In theory yes, it solves some of the problems and introduces others. It isn't usable everywhere NEWID is usable, so if you assign UUIDS as part of a query you are out of luck. It also assumes you are generating all your UUIDs on the same machine without restarting which once again negates some of the benefits of UUIDs.


ULIDs solve these issues.

Basically 48 bits of millisecond timestamp then 80 bits of randomness.

The technique has been used in MSSQL apps since about 2003 (although people called them COMBs instead of ULIDs back then)

https://github.com/oklog/ulid


Nice, I hadn't seen that before. It looks pretty good on first glance.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: