Convoy Ditches UUIDv4 for ULIDs: Efficiency and Scalability in the Big Data Era
During a database migration from MongoDB to Postgres, Convoy decided to replace UUIDv4 with ULIDs as unique identifiers. The article compares UUIDv4 and ULIDs, highlighting ULID's advantages: lexicographical sortability, URL friendliness, and improved database indexing efficiency, albeit with slightly slower generation and insertion speeds. Convoy chose ULIDs primarily to solve pagination performance issues with large datasets. While ULIDs are marginally slower to generate, the performance gains, especially for large-scale data processing, are deemed worthwhile. The article also discusses potential time information leakage risks and user data implications of ULIDs, and briefly mentions the potential future adoption of UUIDv7.