1

I'm developing a Q&A site.

I'm using uuid for the id of questions, and will use that for the url as well.

Question data

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "This is a question",
  "content": "How are you?"
}

URL

https://example.com/questions/550e8400-e29b-41d4-a716-446655440000

However, I have never seen a website that includes the UUID in the URL. For example, a url of a question in stackoverflow is something like https://stackoverflow.com/questions/12345678/this-is-a-question.

Is it a bad practice?

1

Its not bad practice, but it is not a best practice either.

It is generally believed that Google uses information implied in the URL for SEO purposes, and, of-course, when communicating the URL with someone this is likely needlessly long.

I note that sites like stack overflow use a unique ID but not a UUID. (A UUID is a long string which is expected (but not guaranteed) to be unique in the entire world, the key used by Stack Exchange, Wordpress etc is often keyed of a serial number in the database that is associated with the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy