Normalization vs DeNormalization when using a JSON client with a JAVA/RDBMS stack Normalization vs DeNormalization when using a JSON client with a JAVA/RDBMS stack json json

Normalization vs DeNormalization when using a JSON client with a JAVA/RDBMS stack


You should denormalize your data when you send it to your UI layer.

If your data is in a database, that is a great place for normalized data. Use a view that abstracts that normalization and query against the view. The view lets you join tables together to get denormalized data from your database.

In the UI layer you want to have clear, simple display - that's when angular shines best. Unless you are displaying very large amounts of data on the screen or sending huge amounts over the net, you'll fare much better by just sending a denormalized record straight from your db. The DB is great at doing joins and other data querying functions - it is built for that. Javascript can do that, but it isn't the best use of it.


Here is my take on this. When it comes to displaying\listing data I am not worried about the Domain model\classes. For me the data returned should match as much as possible the UI display requirements. Here the intent is to show data to user and not much decision making is done of such screens.

But if data needs to be changed\updated one needs to be more careful of what is send, which entities take part in the updation. Keeping data consistent becomes priority and de-normalization may not be right fit in such cases.