MongoDB Schema Design Best Practices

MongoDB Schema Design Best Practices

MongoDB

3 года назад

143,529 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Unnoticed Spacegoat
Unnoticed Spacegoat - 28.07.2023 20:38

love the energy

Ответить
Dan Cruz
Dan Cruz - 25.07.2023 23:18

If an array can not grow without bound how to we manage something like a users posts? We obviously wouldn't want to limit a users posts so how do you work around that?

Ответить
Coder Blog
Coder Blog - 21.07.2023 00:07

great work Joe!. In fact, it is very interesting to watch your videos about MongoDB, but I am confused about one thing🧐🤨

Ответить
OBEROI OFFICE
OBEROI OFFICE - 05.06.2023 12:36

Explains the conept very well...thanks

Ответить
JB Sinluenam
JB Sinluenam - 31.05.2023 08:26

I have never knew MondoDb schema design can be this entertaining. Thank you, Joe.

Ответить
Juan Bovier
Juan Bovier - 27.05.2023 15:54

💯

Ответить
Atika Najla
Atika Najla - 20.03.2023 02:40

I need more video from you Joe

Ответить
sleeker165
sleeker165 - 03.03.2023 10:30

Excellent demo thanks 👍

Ответить
sneaky kk
sneaky kk - 15.02.2023 17:19

he is so full of energy. bless him!!!

Ответить
Pedro Paiva
Pedro Paiva - 14.02.2023 02:27

I loved your video Joe. Fantastic. You are such a character! hahaha

Ответить
moosegoose12
moosegoose12 - 03.02.2023 07:10

Unwatchable. Just get to the point.

Ответить
Stephen S
Stephen S - 12.01.2023 07:20

What is going on with that painting back there?

Ответить
Kayla
Kayla - 02.12.2022 16:55

So, for many-to-many relationships, Joe suggests to store the relationship data in BOTH tables (very unlike SQL dbs where we avoid redundancy). This helped me resolve a quarrel with myself on the db schema for my first MongoDB Atlas Collections. Thanks Joe

Ответить
Kayla
Kayla - 02.12.2022 16:52

Oh wow, super clever way to handle squillions of data relationships 💯

Ответить
Kayla
Kayla - 02.12.2022 16:37

NO RULES 🤯
NO ALGORITHM 🤯
NO PROCESS 🤯

Ответить
Kayla
Kayla - 02.12.2022 16:28

One to squillions 😂

Ответить
LEarn
LEarn - 30.11.2022 20:20

I can see the passion
video quality is awesome
upto the mark
not just learnt but njyed learning from you
thanks

Ответить
Dan
Dan - 24.11.2022 20:15

dude is awesome

Ответить
vaibhav
vaibhav - 01.11.2022 22:30

Thank you . that's what i was looking for ;)

Ответить
Ananya Kaushik
Ananya Kaushik - 24.10.2022 11:49

You're the best Joe, I had a filthy schema structure until I saw this video.

Ответить
ABHISHEK DUBEY
ABHISHEK DUBEY - 13.10.2022 16:45

okay that Pam's bit was funny

Ответить
小登 XiaoDeng
小登 XiaoDeng - 14.09.2022 08:43

Excellent explanation. Thanks Joe

Ответить
Avishek D
Avishek D - 04.09.2022 11:18

Just read the same blog on the mongodb site. Both are great for beginners.

Ответить
Dale Botha
Dale Botha - 10.08.2022 10:15

Grok! Nice 😊 thanks! This was a super informative and fun video explainer

Ответить
Liquid Code
Liquid Code - 06.08.2022 05:09

SQL => business/enterprise 'storage'
MongoDB => application state !!! =]

Ответить
BelieveInPeople121
BelieveInPeople121 - 26.07.2022 02:36

is joins in mongodb slower than sql server?
because if I use objectids, I will always need joins.

Ответить
Niknack Nutthapon
Niknack Nutthapon - 24.07.2022 20:57

i'm new on your VDO, Love it ! Great tutorial. you make learning super fun

Ответить
paulo dionisio
paulo dionisio - 10.06.2022 15:38

This helps a lot! Thanks Joe!

Ответить
Rollo Rodriguez
Rollo Rodriguez - 07.06.2022 02:00

My app shows a profile page of a student with a list of classes she's enrolled in. Classic Student/Class/Enrolment tables in SQL. In Mongo I would want to just embed everything in 1 document. What if I change the name of a class, or a student drops a class previously enrolled? How do I do this WITHOUT joins? "Throw away" the document (delete) and just make a new one (like a piece of physical paper) with the updated stuff?

Ответить
murph1329
murph1329 - 25.03.2022 18:24

Things people really need to consider before moving everything to MongoDB. It isn't a relational database management system. Saying MongoDB is better than any RDBMS without first specifying the data shows a real lack of knowledge.

Key constraints don't exists in MongoDB. There are no referential integrity checks. We use MongoDB for blob storage and store the MongoDB keys in SQL Server. It's great for that but I would never outright replace a normalized SQL Server or a MySQL RDBMS instance with MongoDB.

Maybe a lot of people see MongoDB as being better because they don't want to worry about optimizing indexes and execution plans, and they see the "read" performance gains...but that comes at a cost of data integrity. It's a schemaless structure which means consistency doesn't exist. It will eat anything you feed it which can be dangerous.

Think about what happens over time as you add/remove properties from your JSON or add/remove reference data based on changing business rules. Think about what that conversion would look like in MongoDB compared to a RDBMS instance. Using the example in this video what if there was a business rule that allowed someone to remove a profession (physical or logical) from all users. Ask yourself what that would look like in MongoDB vs a Relational Database.

I know I sound pretty critical of MongoDB but I don't mean to. We use it and it works well for our needs but it's not a replacement for RDBMS. More of a supplement. NoSQL shines in write-once-read-many scenarios.

Ответить
paracha3
paracha3 - 22.03.2022 23:33

Not sure if i am fan of this delivery style but he was getting the point across.

Ответить
Jman Polo
Jman Polo - 14.03.2022 10:29

Coming from a SQL mindset to MongoDB is an interesting experience, but also kinda freeing in a way.. thanks for making this video!

Ответить
jdragon
jdragon - 14.01.2022 16:56

Can anyone please please help me with how can I make combination of 2 field values unique , should i use a pre save or method to implement it or mongo has something for it

1 i want to have unique anime name for a particular user , so i use a createdBY userid to identify it but I cannt make anime title unique

Ответить
zulmianah
zulmianah - 30.09.2021 15:07

thank you, really helping

Ответить
MaxPayen Venic
MaxPayen Venic - 28.09.2021 21:22

Joe is kind of person that make learning fun

Ответить
An Nguyen
An Nguyen - 28.09.2021 18:22

I love the style of this video so much. It makes learning tech so much more fun compare to other monotone tech videos.

Ответить
TheNamesJT
TheNamesJT - 13.09.2021 01:24

I don't find this video helpful sorry, wish you would of shown actual code using schema and models and how to connect two schemas together. This video is just saying we have to do this and do that but you never show us code wise. VERY HELPFUL

Ответить
Laode Muhammad Al Fatih
Laode Muhammad Al Fatih - 01.09.2021 10:31

Omg. I really love about how Joe explain the all of these schema design. Never feel exciting like this when learning new concept. Thanks Joe ❤️.

Ответить
Ashley Williams
Ashley Williams - 20.08.2021 13:50

What's the best way to model a one to many relationship within a single collection. E.g. users following users? I always use a followers array on the user document that stores other user IDs, but it feels clanky (unbounded array?)

Ответить
Jungtin Number Two
Jungtin Number Two - 18.08.2021 17:17

Love the content <3 by the way you're so cute !

Ответить
Michael Shea
Michael Shea - 04.08.2021 23:41

I am not sure why, but for some reason it looks like you are filming inside a bar before it opens. Weird.

Ответить
Coding Cambodia
Coding Cambodia - 01.08.2021 19:21

I have a collection called "hospitalization" that stores two collections ids a hospital_Id and a patient_Id. My question is I want to query hospitalization collection and search by keyword of field of hospital collection of hospital collection. how can I do so?

Ответить
Zalex
Zalex - 30.07.2021 17:55

You are extremely likeable

Ответить
Châu Phan
Châu Phan - 22.07.2021 17:20

Rule 1: embed unless there is a compelling reason not to
Rule 2: avoid JOINS if they can be avoided
Rule 3: array should never grow without bound
Rule 4: an object should not be embedded if it needs to be accessed individually

Ответить
Elon Hung
Elon Hung - 20.07.2021 08:53

Thanks Joe! That is gold. Very clear and so fun to watch!

Ответить
Bob MacNeal
Bob MacNeal - 10.07.2021 21:46

Good job explaining/confirming my loosely established notions about how to design a NoSQL database. Thanks Joe.

MongoDB is a low-resistance (easy to use) database that’s become my go-to data store for standing up products.

Ответить
Philip Yeo
Philip Yeo - 06.07.2021 11:12

Great explanation. Just what I was looking for.

Ответить
Sumer Singh
Sumer Singh - 06.07.2021 08:05

iam new to mongodb .and i want to know how what is best practices and what is not best but optimum for my needs
1) get all the data and sort and filter client side (i know this is bad)
2) filter data on mongo atlas and then sort client side (dose it make any difference to save resource on server )
3) filter and sort on server and just show data on client

what should i do and what are best practices.

like i get a list of documents from server with embedded objects.
1) should i use project and remove embedded objects i dont need.( does this use more server resource)
2) or i get all the embedded objects and hide them with client side logic

Ответить