Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

UUID v7 vs. ULID: Which Sortable ID Should You Choose?

DEV Community: rails·Zil Norvilis·3 days ago
#fT4Tuhb6
#dev#uuid#ulid#native#database#rails
Reading 0:00
15s threshold

For a long time, if you wanted a primary key that was both unique and chronological, you reached for ULID . It was the perfect "indie" solution to the randomness of UUID v4. It gave us fast database inserts and clean, copy-pasteable URLs. But the world of standards moves fast. In 2024, the IETF officially published RFC 9562, which introduced UUID v7 . It does almost exactly what ULID does: it embeds a timestamp into the first part of the ID. If you are starting a new Rails 8 app today, you might be wondering: "Is ULID still relevant, or should I switch to the 'official' UUID v7?" I’ve looked at both, and while they serve the same purpose, the choice usually comes down to a battle between Native Performance and Developer Experience (Readability) . Here is the breakdown.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More