Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In terms of databases, is "Normalize for correctness, denormalize for performance" a right mantra?

Normalization leads to many essential and desirable characteristics, including aesthetic pleasure. Besides it is also theoretically "correct". In this context, denormalization is applied as a compromise, a correction to achieve performance. Is there any reason other than performance that a database could be denormalized?

like image 503
Aydya Avatar asked Nov 16 '08 03:11

Aydya


People also ask

What is normalize and Denormalize?

Normalization is used to remove redundant data from the database and to store non-redundant and consistent data into it. Denormalization is used to combine multiple table data into one so that it can be queried quickly.

Does database normalization improve performance?

Full normalisation will generally not improve performance, in fact it can often make it worse but it will keep your data duplicate free.

Which type of database is suitable for denormalization?

Denormalization has a place with SQL and NoSQL databases, as well as in data warehousing.


1 Answers

The two most common reasons to denormalize are:

  1. Performance
  2. Ignorance

The former should be verified with profiling, while the latter should be corrected with a rolled-up newspaper ;-)

I would say a better mantra would be "normalize for correctness, denormalize for speed - and only when necessary"

like image 65
Steven A. Lowe Avatar answered Sep 19 '22 23:09

Steven A. Lowe