Click here to Skip to main content
15,887,410 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
Hi,

I have just started a new project, and, I have just discovered that the database implements a 'tractability' requirement whereby every table has "ModifiedBy" and "CreatedBy" (and ModifiedWhen, CreatedWhen) columns for tracing changes to particular Users, as is standard practice.

However, the database designer has implemented this strictly such that these columns are associated to the User table by Foreign Key constraints.

Effectively, the entire database is connected to the User table by these constraints. And worse than that, there are two constraints per table.

When I approach the database with .NET EntityFramework I was confronted by a mass of associations that were meaningless in business terms.

After speaking with the database designer regarding my concerns, I was told that this was necessary to retain correct tracing information.

I can't see how this is acceptable. I thought that these columns are intended to facilitate concurrency, and tracing of sorts, but not strict tracing, as it only traces the last user to make changes, which is of little help in data forensics anyway. And, I thought that heavy duty tracing ought to be conducted by Audit Tables using Triggers.

Am I wrong? Is the kind of 'tractability' described above acceptable data architecture?
Posted
Comments
johannesnestler 8-Apr-14 9:25am    
I think this is a good question, sorry I can't give an answer - hard to tell if anyone can give one - just my opinion: If you use EF with "database first" I'd take the database as it is and fiddle with the mapping (remove not needed associations, create complex-types etc.). I general I'd agree with your arguments against such db-design...
CognitiveFeedback 8-Apr-14 19:40pm    
thank you johannes.
ZurdoDev 9-Apr-14 13:18pm    
It is perfectly acceptable. One app I worked on, all they cared about was who the last person was that changed it.
CognitiveFeedback 10-Apr-14 17:47pm    
dear lord...there must have been a few interesting characters on that team

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900