I'm building a message service for an application. Users are identified by an email address and uid. Uid is also used as the primary key for the user table. I find it faster and simpler to allow my application to see and use that UID than to work with the user's email address. 

Does it matter that my application knows something about the database's design ? This is a specific example, but I mean the question as a generalization... *how much knowledge is 'too much' when it comes to information sharing between an application and its database ?*

I'm asking mostly from the perspective of what would be considered 'good design'. I'm not quite sure how to tag this, suggestions appreciated.