Hacker News new | ask | show | jobs
by karmakaze 2449 days ago
Seems like there's two things here:

  1. username handles
  2. unique page urls
For the usernames I would use system generated (numeric or uuid) internal ids that are associated with usernames.

For the page urls, I would let the author use any string, generating a semi-meaningful default for seo. The page url should include the username handle and so the unique part for the page only has to be unique for that username.

This means that say the db for page urls will have a unique constraint on (user_id, page_url_suffix) where the user_id is the numeric/uuid one. So if user with handle xxx is deleted and a new user uses handle xxx only the new urls for that user are still accessible.