mongodb - From the SQL to the Mongo way of designing a DB -


I understand how to solve some issues on Mongo, I was working with SQL for some time and I know the basics of DB design, many of them are useless in Mongo because it is completely different.

Here's an example I have user credentials (username, password), user information (name, last name, ...), and user decision information (friend list, choice, ecc). MySQL has a good way of organizing it, which is in 3 tables, one for credentials, one for general user information, and one for FB user information, all 3 related to User ID In this way, if I need to enter the user then I only need to query the credentials table, which has very little rows (3 columns; id, username, password)

Okay, how can this logic be translated into non-relational realm? Can I expand my users by adding general information and Facebook notifications as an array?:

  User = & gt; Array ('username' = & gt; 'user1', 'password' = & gt; 'pass1', 'gInfo' => array ('name' = & gt; '', 'lastname' = & gt; ; ''), 'FbInfo' = & gt; array ('like' =>,         / P>      

So this is your real case .

"My so called" relationship 'records' in a reasonable amount per user, and does it keep the information in different 'relational' stores? "

Answer: No , you are a good candidate, using the MongoDB form To do this, a part of that answer can come out, 'I always did that because he told me like this.' '

The half point of the existence of mongodibi is to provide the option of modeling, "second common Form ", in the words" third general form ", where it uses understand for pattern and storage requirements. And generally it is to say that the concept of document embedding avoids < / Strong> another Planet the "related" results need to be achieved because the result is already embedded response document.

What better ID is that you mean in different collections, where MongoDB does not include . Then the case will not be possible, but if you need it then consider the result.

Intelligent JDI said, "Learn, what have you learned?" And apply a different way of thinking about your schema design, Mongodebi will fit you well.

Good luck Padwana.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -