I have a huge experience with MySql and Oracle as relational DBs, but I'm very confused about how properly create collections in MongoDB.
I was reading so many articles and watching youtube videos, but didn't get any real example of how properly create the structure and relationship between two or three collections (properly, best practice or whatever...)
For example... Assume we have three collections Users, Comments, and Posts. What will be right design to use? If the Comments is embedded inside of Posts, then what I have to do in case an User changed his name? Should I run through all comments related to a post in order to update his name in Comments collection? If it's a referenced one, then how to fetch data from all three collections (Post->Comment->User)... Aggregation? If it does, then how MongoDB will behave if the collection will grow up and reach, let's say, 100,000 documents...
Well... I hope you've got my point.
I'll be glad if you guys will post your comments and thoughts about all this stuff and "clarify" all this.
Tnx.
Aucun commentaire:
Enregistrer un commentaire