MongoDB Schema Design Best Practices

preview_player
Показать описание
Title: MongoDB Schema Design Best Practices
Date of stream: 4/9/2020

Have you ever wondered, “How do I model my schema for my application?” It’s one of the most common questions devs have pertaining to MongoDB. And the answer is, it depends. This is because document databases have a rich vocabulary that is capable of expressing data relationships in more nuanced ways than SQL. There are many things to consider when picking a schema. is your app read or write-heavy? What data is frequently accessed together? What are your performance considerations? How will your data set grow and scale?

In this talk, we will discuss the basics of data modeling using real-world examples. You will learn common methodologies and vocabulary you can use when designing your database schema on your application.

► $100 in FREE MongoDB Atlas Credits - Sign up here and apply code JOEK100 on the billing page.

► MongoDB Community
  
► Additional resources:

 ► Subscribe:

► Video archive:

► Follow Me
Рекомендации по теме
Комментарии
Автор

I'm new at using MongoDB and this video has solved many doubts I had about how to design the ideal schema for my project. Thank you very much!

alejandromedina
Автор

Rule No.1 is my favorite.
=> Favor embedding unless there is a compelling reason not to.

yanmoenaing
Автор

Summary:
With MongoDB you have to consider your access patterns not only for indexing but also for schema design.

There are three options for child documents:
1. Embedding
2. Array of references in the parent
3. References in the children (foreign key)

axelneumann
Автор

I didn´t wanted to watch a 1 hour video, I think is the first time I do something like this, and wow. I learned more in one hour than in 2 days readding weird written tutorials, guides and short videos. Thank you very much. <3

BHVampireLF
Автор

I know it’s a bit old, but as a recent convert this was exactly what I needed 😊😊😊

TonySheen-dc
Автор

I'm sorry, but this sounded like a sales pitch :) Understandable since you work for MongoDB. MongoDB has a predecessor, namely XML databases. MongoDB has a lot in common with XML databases. I used to work a lot with XML databases and my experience is that document databases are a * bad * fit for business domain models. You talked about cons and you didn't mention the most important con: update anomalies. But wait a minute. You mentioned this problem and came up with a beautiful solution: a reference. And even better, there is something like unbounded references. I would say, keep evolving and you end up with an SQL database :). In my experience, document databases are great when you store documents as is. For example when you have a message warehouse, or for logging/auditing. XML databases are also used by publishers to store books (DocBook and DITA for example), newspapers etcetera. But using a document database for your business model. That's a bad idea to my opinion. I have the experience to use a very performant XML database as the enterprise database for a company and it had very nasty legal consequences. It was just not the right fit . A relational model is far better. It is also much better to have a schema for you business domain model. I would get very nervous if a developer would store its documents without a schema. No rules, really? Is that a positive thing for your vital business data? Good luck!

compateur
Автор

I am creating a bug tracker web app and this has answered my questions about how I should structure my many to many relationship, so thank you!

louierichardson
Автор

Joe you’re a great instructor. Starting with the context/use case and then referencing the parts is so appreciated. Your channel is wildly underrated. Also love the humor references.

InternetLiJo
Автор

Two way referencing is just a PURE GOLD!!! Now it seems obvious, but I was trying to solve similiar problem without that 2WR knowladge 🙈, and made no progress for few hours, THANKS MAN!

bartoszmazur
Автор

what i learned after just this single video was 10x times more than a 200pgs doc i read. thank you<3

ardalanhadizadeh
Автор

Super helpful. I was on the fence with PostgreSQL and MongoDB. But this convinced me to go Mongo

toneking
Автор

Great video, these intermediate videos are what youtube is lacking

DaDa-grcy
Автор

This was really good. One thing that made me laugh is in the begining you stressed that there are no rules and then later you have "Rule 1: favour embedding" haha I just thought that was funny. Thanks for the presentation, it was helpful!

PuzzlingQuestions
Автор

Solved all my doubts man since morning was searching for embedding design. Thanks a lot 👍

alirasheedmd
Автор

Really enjoyed your video. Was kinda funny when you said MongoDB has no Rules but then we have a section with Rules. hehe. Altough they are very helpful to keep in mind. Thanks for the great content!

andreornelas
Автор

Love the 1960's-1970's Campagnolo Record bicycle de-exploding at around 25:20 into the video!

dgillies
Автор

Great informative video to get started with NoSQL when you come from a relational DB background. Thanks!

AngeloMiranda
Автор

I hate your vocal fry so much my god I hope this video is worth it

EDIT: My opinion has not changed - your vocal fry is indeed terrible, but the video is extremely good, it's informative, concise, well presented and paced. I will be recommending it to everyone starting with mongo db. Also you seem like a really likeable guy :D

someoneelse
Автор

this one video explained more than a couple videos combined I watched before I stumbled here. :) I have subscribed.

daminirijhwani
Автор

I am new to No SQL and coming from RDBMS background. I enjoyed this session and it gave me very good idea about how to design Mondo DB.

vaibhavrana