0

i have a question for the performance in meteorJS. Before i used meteorJS is always wrote my Applications in PHP and MySQL. In MySQL i always created a lot of tables with many connections betweens them.

For example:

Table User
id;login;password;email
Table User_Data
user_id;name;age

My questions is now how i have to design my MongoDB collections. Its nice that the collection are build like js objects so i dont have to predesign my tables and can always easy change the collumns. But is it better to combine all data to one collection or to several collections ?

For example:

Table User
_id;login;password;email;data:{name;age}

Is it better or worse for the performance ? Or is it the wrong pattern to design MongoDB Collections ?

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
TJR
  • 6,307
  • 10
  • 38
  • 64
  • 1
    Have a careful look at [this question](http://stackoverflow.com/questions/21798844/document-creator-as-username-or-userid/). All of the answers add something unique and useful. I think most of what you want to know is in there. – David Weldon Feb 27 '14 at 02:47
  • looks interesting. Thanks for this. i will read the blogs. – TJR Feb 27 '14 at 02:58

1 Answers1

1

The question mainly about MongoDB data modeling. What you'll learn applies to MongoDB used with Meteor or with anything else.

http://docs.mongodb.org/manual/data-modeling/ talks about data modeling with MongoDB and is a good introduction.

In your particular case, you can read more about how to avoid JOINs in MongoDB.

Community
  • 1
  • 1
Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404