Hashes vs Numeric id's

Posted by Karan Bhangui on Stack Overflow See other posts from Stack Overflow or by Karan Bhangui
Published on 2008-10-13T04:38:47Z Indexed on 2010/06/12 19:23 UTC
Read the original article Hit count: 426

Filed under:
|
|

When creating a web application that some how displays the display of a unique identifier for a recurring entity (videos on YouTube, or book section on a site like mine), would it be better to use a uniform length identifier like a hash or the unique key of the item in the database (1, 2, 3, etc).

Besides revealing a little, what I think is immaterial, information about the internals of your app, why would using a hash be better than just using the unique id?

In short: Which is better to use as a publicly displayed unique identifier - a hash value, or a unique key from the database?

Edit: I'm opening up this question again because Dmitriy brought up the good point of not tying down the naming to db specific property. Will this sort of tie down prevent me from optimizing/normalizing the database in the future?

The platform uses php/python with ISAM /w MySQL.

© Stack Overflow or respective owner

Related posts about hash

Related posts about webapp