2 ms·
ULIDs are a much better answer than type-4 GUIDs. You get insertion-order sorting with a large random component to prevent collisions/guessing. A similar solut
by tatersolid 9y ago
ULIDs are a much better answer than type-4 GUIDs. You get insertion-order sorting with a large random component to prevent collisions/guessing.
A similar solution called COMB identifiers dates back at least 15 years in the MSSQL community.
Watch out for sort order in MSSQL with binary ULIDs cast to UNIQUEIDENTIFIERs; they sort with the last 4 bytes as most significant, so some byte swapping is necessary to prevent the performance degradation caused by index page splitting (I wrote a ULID implementation for MSSQL that handles this).
https://github.com/alizain/ulid https://github.com/alizain/ulid