Hasty Briefsbeta

ULID: Universally Unique Lexicographically Sortable Identifier

10 days ago
  • #ULID
  • #Postgres
  • #Go
  • ULID (Universally Unique Lexicographically Sortable Identifier) is introduced as an alternative to UUID, addressing its limitations.
  • ULID is lexicographically sortable, case insensitive, URL safe, and compatible with UUID.
  • ULID structure consists of a 48-bit timestamp followed by 80 bits of randomness, ensuring sortability and uniqueness.
  • A Go and Postgres example demonstrates ULID's seamless integration with existing UUID columns.
  • ULID's time-based prefix ensures new records are placed at the end of the index, improving database performance.
  • ULID can generate 1.21e+24 unique identifiers per millisecond, suitable for most applications.
  • Limitations include potential hot spots in high-volume write systems due to timestamp clustering.
  • UUID v7 is mentioned as a future standard that adopts a time-ordered structure similar to ULID.