Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialFatimah Anwar
Android Development Techdegree Student 10,416 Pointsin database concept what is denormalization?
what is denormalization in simple words please? i read about it but a did not understand any.
2 Answers
Ken Alger
Treehouse TeacherFatima;
Well, denormalization would be the opposite process. Including redundant pieces of data in each table. To continue with the previous example, the Employee
table would include in it the department information. This would indeed increase read performance as only one table would need to be accessed to obtain the information. However, updating the database becomes more resource intensive since now making the change of "HR" to "Human Resources" would have to be done across multiple rows, potentially.
Database design is a complex subject and the use case of the data is often a contributing factor in how much normalization/denormalization is done on a data set. If read operations are of primary concern, you will indeed want to optimize the database for that. For example, if you are storing historical data that won't change and needs to be written to infrequently, read operations are probably of higher importance. On the other hand, if you are doing a lot of write operations, like for a busy e-commerce site, optimizing the database for that and normalizing the data set is of higher importance.
Post back with further questions.
Ken
Ken Alger
Treehouse TeacherFatima;
The concept of normalization in databases is the process of organizing the columns (attributes) and tables (relations) of a relational database to reduce data redundancy and improve data integrity. In a nutshell, you want to prevent data that is repeated in a given table.
For example, if you had an Employee
table that included the department employees worked in, since that data could, and likely would, be repeated, you would set up a separate Department
table. Then in the Employee
table you would have a reference (foreign key) to the Department
table. This normalization process allows for data to only have to be changed in one place, in this example "HR" would only have to be changed to "Human Resources" one time.
This is a pretty high level and simplified view of normalization, but hopefully that helps.
Post back with further questions.
Happy coding,
Ken
Fatimah Anwar
Android Development Techdegree Student 10,416 Pointsthanks sir but that about normalization , and i asked about "denormalization", what i understood it is process to improve the read performance of database, i just need a simple example of it, and what is its drawbacks?
Fatimah Anwar
Android Development Techdegree Student 10,416 PointsFatimah Anwar
Android Development Techdegree Student 10,416 PointsThanks, that was really helpful