I am little confused tho. first anti-pattern is massiv arrays…. with an example of a very tiny array only to proceed with the second anti-pattern which are massive collections which solution is to create infinite growing arrays aka massiv arrays of sensor data? i am trying to get into MongoDB and this sounds kinda useless. „don’t make things too big our system just can’t handle it“…..
I just finished this 3 part series and thanks so much for the guidance and the laughter in your Anti-pattern challenge with all of the Parks and Rec references! This is such a great choice for this teaching.
Thank you, that helped a lot. I just have a question of your example about river stats. Let's suppose we have millions of objects inside the readings array, isn't it the same anti-pattern you showed in the first example? About massive arrays
Not really. In her example she said she's bucketing the information, storing one hour's worth of information per sensor 15:55, so each document will have at most 60 items in the readings array (one reading per minute), and I think that is not considered a massive array... But yes if you had millions of readings then it would be a massive array anti-pattern...
Didn’t knew extended reference pattern is a thing. Been doing data modelling using MongoDB blindly and the biggest dilemma faced is should I embed or not. Even if I applied extended reference, I still have to check if the extended embedded data was part of the update or not in the backend, further complicating the logic behind. So are we going to choose more codes, vs performance cost?
5:50. Regarding the 16MB document maximum. I doubt that that would occur as you wouldn't have hundreds of thousands of employees in 1⃣ building, right? Now, given that I may want to frequently see all of the buildings and employees separately, so yeah, probably still need 2 collections.
At 17:01 did you mean the including "day" in the default index and not "hour" because the hour level data is being stored in the readings? This will potentially also keep the readings object bounded to 24.
Is embeding documents recommended or linking data with ObjectId and ref If I want to store posts of the user in its doc like: new mongoose.Schema({ email, pass... posts: [postSchema] }); Is it recommended or just adding authorId field like this: authorId: { type: mongoose.Schema.Types.ObjectId, ref: 'user' } is recommended? Any help would be appreciated. 😊
Mam your explaination is good.but it's too much theoritcal. Can you please create a mini project using spring boot and mongodb with customer module,order module,billing module in which you can design a mongodb data modeling. This will practically help millions of people. Thanks mam and you look very cute and sweet.