Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns and there will be about 10 child entities inheriting from the parent. Each child entity will have about 10 columns. I thought it made sense to give the parent entity its own table and give each of the children their own tables - a table-per-subclass structure.

Today, my users requested to see the structure of the system I created. They balked at the idea of the table-per-subclass structure. They would prefer one big ~100 column table because it would be easier for them to perform their own custom queries.

Should I consider denormalizing the database for the sake of the users?

like image 920
James Jones Avatar asked Nov 13 '09 16:11

James Jones


3 Answers

Absolutely not. You can always create a view later to show them what they want to see.

like image 74
TLiebe Avatar answered Sep 23 '22 23:09

TLiebe


They are effectively asking for a report.

You could give them access to a view containing all the fields they require... that way you don't mess up your data model.

like image 20
Galwegian Avatar answered Sep 23 '22 23:09

Galwegian


No. Structure the data properly and if the users need the a denormalized view of the data create it as a VIEW in the database.

Alternatively, consider that perhaps an RDBMS is not the appropriate storage tool for this project.

like image 44
Larry Lustig Avatar answered Sep 21 '22 23:09

Larry Lustig