0

We are planning to do an e-commerce shopping site with PHP-MYSQL combination.

I read in almost every link related to Normalization & Denormalization : Normalize until it hurts, denormalize until it works.

One thing I understood is Normalization is must for good performance , am i right ?

We have to do Denormalization only when we face problems of Performance [ the very low page speed ] , otherwise Denormalization is not required.

Is for 100% it will hurt - Normalization? can we do anything to prevent [not to hurt.] can we take some steps for performance boost other than Denormalizing & Refactoring complete database again.

Can we do Denormalization without doing Normalization before ?

1
  • 1
    "Low page speed" -- If you are 'paginating' by using OFFSET, see my blog on why it is slow and how to speed it up. Lack of good indexes is a very common performance problem; see my index cookbook . Normalization is pretty far down the list of performance 'solutions'.
    – Rick James
    Commented Sep 27, 2016 at 5:04

1 Answer 1

1

credits : Vladimir Oselsky

Normalization is never for a performance of reads it is for data integrity and performance of writes. You normalize to avoid redundant data and creating problems by having same data exists in different locations. If you want most amazing performance, you denormalize by throwing everything into a single table and create a lot of indexes. That is why for reporting (DW) it is a practice to denormalize to increase the performance of reads. Save yourself a lot of headache and do a lot of reading on how other people solve same problem.

I strongly believe in 3NF, but going beyond that is absurd in my book, I have yet to see a valid business case for doing anything above that. Sooner or later you will find a need to denormalize for a specific process, usually it is done for reporting, data warehouse need. A good rule is OLTP = Normalize, OLAP = Denormalize.

It is a nature of database design and request from the business. Whenever you are designing a system, you are designing for a specific purpose, and later someone else comes along and request information that you might not have been prepared to give, in that case, you are required to denormalize to provide a best performance.

To increase the performance go for "Indexes, query tuning, hardware upgrades, server configuration and etc"....

1
  • 1
    Those comments work for smaller tables; they fall apart for larger tables. When a table gets too big to be cached in RAM, normalization may provide significant space shrinkage to decrease (even eliminate) I/O. For big tables, 90% of the time is I/O, so this can make a big difference. My mantra: "Normalize, but don't over-normalize". In particular, do not normalize datetime or float, or any other "continuous" value.
    – Rick James
    Commented Sep 27, 2016 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.