views:

294

answers:

8

What are the pros/cons of de-normalizing an enterprise application database because it will make writing reports easier?

Pro - designing reports in SSRS will probably be "easier" since no joins will be necessary.

Con - developing/maintaining the app to handle de-normalized data will become more difficult due to duplication of data and synchronization.

Others?

+5  A: 

The only time you should consider de-normaliozation is when the time it takes the report to generate is not acceptable. De-normalization will cause consistentcy issues that are sometimes impossible to determine especially in large datasets

ennuikiller
I would agree and add:If you are going to de-normalize, you should also make sure you define some procedure or process to make sure that all of the de-normalized data is kept in sync and up-to-date.
FrustratedWithFormsDesigner
+18  A: 

Denormalization for the sake of reports is Bad, m'kay.

Creating views, or a denormalized data warehouse is good.

Views have solved most of my reporting related needs. Data warehouses are great when users will be generating reports almost constantly or when your views start to slow down.

This is why you want to normalize your database

  1. To free the collection of relations from undesirable insertion, update and deletion dependencies;
  2. To reduce the need for restructuring the collection of relations as new types of data are introduced, and thus increase the life span of application programs;
  3. To make the relational model more informative to users;
  4. To make the collection of relations neutral to the query statistics, where these statistics are liable to change as time goes by.

—E.F. Codd, "Further Normalization of the Data Base Relational Model" via wikipedia

Bob
View are not always the answer, even though so many recommend them. If you have a complex join because of a highly normalized database design, then the run time for a view can become unacceptable.
Irwin M. Fletcher
+1 for mKay - jk, my thoughts exactly
Travis Heseman
I agree with Irwin, views will not help if the issue is performance
ennuikiller
Then go with a data warehouse. Off loading your reporting to another database server is a good idea anyway.
Bob
The question didn't mention anything about performance issues, only that not having to do joins would make things "easier", so views certainly seem like the right approach in that case.
Laurence Gonsalves
That is just his Pro, not a stated requierment
Irwin M. Fletcher
Irwin is right. I'd like to know as many pros and cons as I can. Normalized performance can be a con; however, I know that sometimes it can be a pro since normalization can create much smaller results sets.
Travis Heseman
if your RDBMS supports materialized views then performance isn't a con anymore either, but a dedicated data warehouse on a separate machine is always a better choice.
fuzzy lollipop
A: 

Another Con is that the data is likely not to be real-time as there is some time moving around the data to go from a normalized form to a de-normalized. If someone wants the report to be up to the very second it was requested, that can be tough to do in this situation.

If this is a duplication of the synchronization in the original post, sorry I didn't quite see it that way.

JB King
Actually, the question wasn't about just-in-time de-normalization. But actually de-normalizing the structures permanently. Which is what I've been asked to do.
Travis Heseman
My intention was that some requirements for reports may change over time and while the report right now may generated for each month or quarter, someone may want to get the data ASAP and thus the dilemma is born.
JB King
I see. For right now, the reports are run real-time through SSRS report viewer. The users have a bunch of dropdowns and fields through which they can change parameters and re-run at their whim. Our current normalized model has no performance issues with this real-time process.
Travis Heseman
+5  A: 

Don't denormalize just to get rid of complexity in reporting, it can cause huge problems in the rest of the application. Either you don't enforce the rules resulting in bad data or if you do then inserts, deletes and updates can be seriously slowed for everyone not just the two or three people who run reports.

If the reports truly can't run well, then create a data warehouse that is denormalized and populate it in a nightly or weekly feed. The kind of reports that typically need this do not generally care if the data is up-to-the minute as they are usually monthly, quarterly, or annual reports that process (and especially aggregate) large amounts of data after the fact.

HLGEM
A: 

Travis -

I hope you are still seeing these responses. I'm currently having the same issue. I'm going to be asked to denormalize to speed up reports. I feel I could probably use a similar arguement you are using. Was your arguement a success? Do you mind sharing it? If it was a success would you mind sharing your design solution?

Thanks,

Fletch

Fletcher Munson
A: 

You can do both... let the normalized database for applications. Then create a denormalized database for reports, and create an application which regulary copy data from one database to the other.

After all, reports don't always need to have the latest updated data, most of the time you can easily launch an update every 1 hour on the reporting database, and only once a day day.

Nicolas Dorier
+1  A: 

Beyond the data warehouse and views solutions provided in other answers, which are good in some ways, if you are willing to sacrifice some performance to get a good to the last second data, but still want a normalized database, you could use on Oracle a Materialized View with fast refresh on commit, or in Sql Server, you could use clustered indexes for a view.

kurast
A: 

Fully agree - denormalization is Bad practice. May be are you use not enough good report generator? :)

Merl