javascript - Meteor.js - Should you denormalize data? -


This question is driving me crazy and I can not take my head around it. I came from a MySQL relational background and am using Meteorjs and Mongo. Take the example of posts and writers for the purposes of this question. An author for many articles has come in two ways to do this:

  1. There is a collection of posts - each post contains the author's information written in the document. Of course this denormalization and issues such as if the name of the author changes, how do you keep the data right.

  2. There are two collections: posts and authors - each post has an author, the id that references the author's collection, then I try to "connect" to a non-relational database, while the response I am trying to maintain

  3. I think the degree of MongoDB denormalization is acceptable and I take the exam applying embed as to actually run against the ideals of Mongo Feels.

    Can any light shed any specific thing, especially what is the right approach to properly appraise my app data and to be manageable? / P>

    thanks

Denormalization is useful when you are scaling your application and You see that taking some time to complete certain questions I have also found that most mozed developers forget about data normalization, but this is another topic.

Some developers say that: "Do not use inspection and inspection because it is slow". We are building real-time applications so that one thing is normal, this is a CPU intensive app design.

In my opinion, you should always design a generalized design, and then you have to decide, try and test which fields, which can be repeated / denormalised, improve your app's performance. Are there. Example: You remove 1 query per user. UI requires an additional area and it is repeated, etc.

With denormalisation you have an additional cost to pay, you have to update denormalized fields according to the main collection. Example: Suppose you are in a collection of authors and articles. On each article you have the author's name. With the usual scenario, the author can change his name, it works fine, with a denormalised scenario, you have to update the author's document name and each article owned by this author, with the new name.

Having a generalized design lets you make life easier but denormalisation, eventually, becomes necessary

From a MeteorJs perspective: With a generalized scenario, Are sending. With the distorted scenario, you send only 1 collection. You can join responsibly on the server and send 1 archive to the customer, although it increases the usage of the RAM due to the server.

Denormalisation is something that is very clear for the requirements of your application. You can use the database to find ways to make your application faster. Design is the only factor 1, which you can demonstrate Play with performance while performing.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -