RowId and Id

Topics: Business Logic Layer
May 7, 2012 at 9:12 PM

In the database, the primary keys for tables of Users, Roles and UserRoles are XxxID (int). But some other tables (like Rights, RightRoles, Profiles, Settings, etc) use XxxRowID. Is there any special meaning in it? Do we intentionally name them differently for some purpose?

Some tables use the XxxId (uniqueidentifer) and XxxRowId (int) at the same time. Like Blogs, Categories, etc.

Another thing I noticed is that the primary keys in a table is not used in relationship. For instance, in the table of UserRoles, UserName and Role are used to define the relationship instead of UserID and RoleID. I guess the benefit is we don't have to join tables to retrieve the text of username and roles.

But that theory is not working in the table 'Categories', where BlogID(uniqueidentifier) and CategoryID(uniqueidentifier) are used instead of BlogRowId (int) and CategoryRowId(int). There is no obvious benefit in this.

Confused, I am writing to see if any expert can help me understand this practice. I trust there must be some benefit since BlogEngine uses this design. Please let me know why it is so.