Database IDs Have No Place in URIs (2008)

Database IDs Have No Place in URIs (2008)

However (and you knew this was coming), one aspect of the implementation of Stack Overflow troubles me somewhat: it appears the site is using numeric database IDs within s.

Note that I use URI rather than because one of the stated aims for Stack Overflow is that its content be readily indexable by search engines, so that people can enter their specific programming question into Google and hopefully amongst the top results should be the definitive answer on Stack Overflow. URIs in Stack Overflow look like this:

—As you can see, there’s a number, followed by a Google-friendly version of the question title, which is often called a “slug”. The key point is that the slug in the URI is the key that’s used to get hold of your model object; everything can still be stitched together using numeric database IDs under the hood, just don’t expose that to your site’s visitors.

Source: johntopley.com