Re:Database IDs Have No Place in URIs (2008)
by luckylion on Friday May 10, 2019 @09:03AM
(#19877304)
> More so than in mark up? If so why?
Easy to enumerate, if that's a concern.
In the case of URLs, you can have /questions/:id/:slug, and then load the question by :id, but if :slug doesn't match the slug you've got in the database, then return 404.
Re:Database IDs Have No Place in URIs (2008)
by luckylion on Friday May 10, 2019 @09:20AM
(#19877422)
Sure, but that means that you have a unique key combination of id + slug for all intents and purposes. The argument for having the ID is that the slug can change and you can redirect. If you don't redirect, that argument falls flat, and if you redirect you're easier to enumerate.
More so than in mark up? If so why?
Should surrogate keys never be exposed to users in any form? Then what's the alternative? Nonces for everything, all the time?