Dev Tools · 1h ago
Why v7 UUIDs are becoming the default for database keys
v7 UUIDs embed a timestamp, making them sortable and more efficient for B-tree indexes than random v4 UUIDs. The RFC 9562 standard offers a drop-in replacement that reduces index fragmentation. Developers can hand-roll both versions, but v7's time-ordered prefix improves database performance without sacrificing uniqueness.
Meridian48 take
The shift from v4 to v7 is a practical optimization for database performance, not a revolutionary change—but it's one every backend developer should know.
Read the full reporting
Why v7 UUIDs beat v4 for database keys (and how to hand-roll both) →
DEV Community
uuiddatabase-keys