DEV Community

Discussion on: Do not expose database ids in your URLs

Collapse
thumbone profile image
Bernd Wechner • Edited on

The only drawback I see to UUIDs is that they are hellishly long, ugly and unfriendly. Shorter URLs are a strong preference and what lead, many of us to use the simply integer primary key.

That said, as far as slugs (when introducing an esoteric term like 'slug' I'd always counsel linking to a useful explanation) go, many sites successfully use words ... and as we all know by now three random words are as secure as long random strings but far more friendly, and as such many slugs are in fact constructed from titles and other related sources reducing to something like a word or two or three - separated.