I keep coming across questions and articles on the internet suggesting that it's not a good practice to have the IDs of your database records visible to the public. Yet I've never taken it seriously myself nor have (in my professional career) come across an application that actively attempted to hide IDs. I've recently been working on an MVC application and have my public URLs in the following format:
/Book/55/title-of-book
Should I make efforts to change the Id
part of the URL (55) into a hash of some sort? For example here's how Reddit has its URLs:
/r/subreddit/comments/36v4kb/title_of_article/
If I were to keep the IDs hidden in my URLs I'd also have to strip them from all places where they publicly appear in my code and do changes in my database. That's not an easy task but I have no problem doing it if it's considered good practice.
What are the benefits of keeping IDs hidden and what are the best ways of going about hiding them?