Database identifiers are not important… to your users. Sure database identifiers are important to the database, and they are important to your data access layer, but they are meaningless to the users of your application.
Here are two simple rules I keep in mind when identifying unique entities on a user interface.
- Never label anything as an “Id” in the user interface.
- Since you can’t call anything and Id, don’t show Ids.
My problem with exposing database identifiers is echoed by Brian Guthrie in his article entitled “Don’t use auto-incremented database IDs as your resource identifier”. Database Ids lack any meaning, they are usually numeric, and for that matter are rarely unique at all.
Instead of exposing the database identifier try and find some other unique identifying property of your object that does make sense to your users. If its an order call it an order number, if its a customer call it a customer number.
Obviously this isn’t easy, and it may not be practical for all situations. So, for the sake of staying agile just try and find a happy medium.