MongoDB Schema Design Best Practices

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 318

  • @alejandromedina649
    @alejandromedina649 4 года назад +97

    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!

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +7

      This is the best thing I have ever heard - thank you!

    • @DIZZLEBOI44
      @DIZZLEBOI44 4 года назад +1

      @@JoeKarlsson have a mongodb/admin job coming up

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      @@DIZZLEBOI44 Nice!

    • @Ikilledthebanks
      @Ikilledthebanks Год назад

      What’s the easiest way to manage streams from mongo into snowflake using Kafka. The data structure changes and the update replace does not include data elements of the prior record. We require only the most recent update to the record no history

  • @yanmoenaing71
    @yanmoenaing71 4 года назад +29

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

  • @axelneumann8443
    @axelneumann8443 4 года назад +20

    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)

  • @InternetLiJo
    @InternetLiJo 3 года назад +16

    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.

    • @JoeKarlsson
      @JoeKarlsson  2 года назад

      Thank you so much. I really appreciate that.

  • @BHVampireLF
    @BHVampireLF 3 года назад +5

    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.

    • @JoeKarlsson
      @JoeKarlsson  3 года назад +1

      Oh my gosh! That's awesome! I'm so glad it was useful for you! :)

  • @compateur
    @compateur 3 года назад +5

    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!

    • @OfficialGOD
      @OfficialGOD 3 года назад +1

      I'm using mongol for logging and analytics

    • @vinfern27
      @vinfern27 3 года назад +3

      When it says no rules. It means you define the rules that fit your business rather than let the rules define your business. you can enforce rules at the db level

  • @bartoszmazur5168
    @bartoszmazur5168 3 года назад

    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!

  • @TonySheen-d4c
    @TonySheen-d4c 27 дней назад

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

  • @ardalanhadizadeh1799
    @ardalanhadizadeh1799 3 года назад +1

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

  • @DaDa-gr7cy
    @DaDa-gr7cy 3 года назад +1

    Great video, these intermediate videos are what youtube is lacking

    • @JoeKarlsson
      @JoeKarlsson  3 года назад +2

      Right? I feel the same way - lots of beginner level content, but not much for people beyond that. So glad you enjoyed this video!

  • @louierichardson123
    @louierichardson123 3 года назад +1

    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!

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      That's so cool! Can you send me the code? I would love to check out what you're working on!

  • @distributed-systems
    @distributed-systems 3 года назад +3

    12:32 Embedding
    17:10 Referencing

  • @toneking972
    @toneking972 4 года назад +2

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

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      This is the best feedback - thank you so much!

  • @daminirijhwani5792
    @daminirijhwani5792 3 года назад +1

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

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      Oh my gosh! Thank you! I'm so glad it was useful! :D

  • @khasmeenusman3931
    @khasmeenusman3931 3 года назад +1

    No one explains mongodb schema as you did. Thank you man. I finally understood MongoDB

    • @winfle
      @winfle 5 месяцев назад

      russia is a terrorist state, btw

  • @alirasheedmd
    @alirasheedmd 3 года назад +2

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

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      That's amazing! Thank you for sharing!

  • @splendorman7922
    @splendorman7922 3 года назад

    better than official mongodb videos and tutorials.. thanks!

  • @MohamedAsfer
    @MohamedAsfer 4 года назад +15

    WoW. Really enjoyed this session. Thanks for the effort

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      Thank you so much! I am so glad you enjoyed it!

  • @karamjeetsingh7637
    @karamjeetsingh7637 4 года назад +5

    This was super helpful, Cleared many doubts I had. Thank you very much!

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      That's amazing! Thank you so much for watching! :D

  • @dgillies5420
    @dgillies5420 8 месяцев назад

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

  • @vaibhavrana4953
    @vaibhavrana4953 3 года назад

    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.

  • @morapedikhutwane7405
    @morapedikhutwane7405 3 года назад +8

    Thanks a squillion Joe! 👊🏽
    This video is very informative, helpful and enjoyable 😊

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      This is my favorite comment :D

  • @peaps
    @peaps 3 года назад +1

    Does referencing have to use the complicated BSON _id property? Can't we just use another normal property, like, name (presuming it to be unique) ?

  • @AngeloMiranda1999
    @AngeloMiranda1999 3 года назад +2

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

  • @PuzzlingQuestions
    @PuzzlingQuestions 4 года назад +3

    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!

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +1

      LOL - you're totally right. I totally missed the irony! hahaha! :D

  • @anuragtiwari3032
    @anuragtiwari3032 4 года назад +1

    Thnx a lot man , this answered so many of my doubts. Deserves 10 million views, but we all know the world 😉

  • @epacke
    @epacke 4 года назад +3

    Excellent presentation, it served super well as a foundation for the design discussions about our NoSQL schema. Although we went to with CouchDB all that you said felt relevant. Instant like!

  • @sarahahmed2112
    @sarahahmed2112 3 года назад +1

    Thank you so much for posting this presentation. I appreciate the multiple recaps throughout the lecture, helped me a lot.
    And I appreciate the many resources.

  • @biomedicaltechworld-btw8447
    @biomedicaltechworld-btw8447 3 года назад +2

    Thanks for making such a comprehensive video for us. Stay Blessed.

    • @JoeKarlsson
      @JoeKarlsson  3 года назад +1

      I got you! 🥰

    • @biomedicaltechworld-btw8447
      @biomedicaltechworld-btw8447 3 года назад

      @@JoeKarlsson started watching MongoDB University course after this video.
      Your company must be proud of you. 👌🧡

  • @abdulrashid2023
    @abdulrashid2023 3 года назад

    One of the best video about schema design in mongoDB thanks @Joe Karlsson. I subscribed

  • @andreornelas
    @andreornelas 3 года назад +1

    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!

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      hahaha - lol - I def lied there! :P

  • @sf2998
    @sf2998 4 месяца назад +2

    Thank you for this great video. Do you think nosql can completely replace sql? I feel it can if the scheme is done properly...

    • @JoeKarlsson
      @JoeKarlsson  4 месяца назад

      It depends on the used case, but for a lot of cases noSQL databases work just fine

  • @attilathehun1561
    @attilathehun1561 4 года назад +3

    Nice Video , Every thing is crystal clear
    you saved my lots of time , i am new to mongoDB from MySql background keep it up.

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      This is the best compliment! Thank you so much!

  • @rajivraghu9857
    @rajivraghu9857 2 года назад +1

    Excellent Joe!! loved you presentation. Really helped me to clarify some doubts on mongo .

  • @siddharthskumar6831
    @siddharthskumar6831 4 года назад +1

    Most underrated talks..awesome...👏👏👏👏

  • @here2thrive
    @here2thrive 3 года назад

    1:20 -- Already I see you are a genius. Well done with this idea.

  • @joseluissanchezortiz3599
    @joseluissanchezortiz3599 4 года назад

    Thanks friend. You explain very good. from colombian, Im speak spanish and I dont have seen any video so well explained in Spanish

  • @prajunathunt
    @prajunathunt 2 года назад +1

    The revisions at the end was helpful. Thank you

  • @codecomposer88
    @codecomposer88 2 года назад +1

    Thanks for a good video.
    Coming from many years with SQL I can clearly see some benefits with NoSQL. The main selling point for me is the loose data structure of the individual documents as well as query speed when everything you need is embedded in a single document. This is where NoSQL really shines over SQL
    Maybe I'm wrong, but I get the feeling that in most cases we still need traditional SQL-like relationship references between decoupled documents and quickly we end up with something that looks an awful lot like good old SQL.

  • @victorkingma4371
    @victorkingma4371 9 месяцев назад

    Excelent tutorial, gave me a entire panoram of mongodb

  • @princematthew2145
    @princematthew2145 2 года назад +1

    Fantastic Joe. Great Learning. When you talk about embedding example regarding product and parts, you favor parts. But you keep referencing to the size limit of the document. Yes its a problem, But more than that there is a bigger problem of consistency. If you embed a part and If you update the part from a screen, you have inconsistency. When you show the product you will show the old values. I am curious as to why you are not mentioning about inconsistency? I am a newbie in nosql. heavily influence by relational theory. Eager to know your thoughts

  • @jmgomw7787
    @jmgomw7787 4 года назад +1

    This is a very cool, well explained and fun talk on mongodb. 100% recommeded!

  • @lazareric
    @lazareric Год назад +1

    I love you man, not many people talking about mongo, with proper knowledge of it. Good on you.
    An interesting question maybe, client wanted an architecture where each A collection item has many B collection items attached to it by reference, BUT querying A collection requires searching based on B collection items' properties, it was super slow, whenever I queried (50m+ documents), a collection based on properties of a different collection (so match, lookup, and the match on the lookuped documents), the query was super slow. The weird part is lookup was relatively fast even, but than the match on the lookedup documents' properties was weirdly very, very slow, any ideas why that happen? It's weird as I imagine once lookup is done, each document gets that embedded and then goes into the next stage (match) in this case, so why was match so slow, as it was supposed to match based on the already available properties embedded in the document in that stage with data in the stage (or maybe I don't understand, and it doesn't really work like that what I explained), it didn't have to use an index or do a collection scan, literally just filter documents in the stage, that's the only mind boggling thing in mongo that i don't get, everything else I love

  • @arnaudtisset
    @arnaudtisset 4 года назад +1

    Professional SQL developer here Actually the first part of your video is a little misleading, we do design sql databases with the queries in mind and We denormalize when necessary.

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +1

      You're right - It's not an antipattern in SQL to denormalize for performance reasons - thank you for clarifying. :D

  • @code2287
    @code2287 2 года назад

    Nice resource.....could we get a complete mongodb schema playlist

  • @alzamer88
    @alzamer88 3 года назад

    I think it was mentioned that you may not want to embed a document so that we won't fetch extra data that we don't want.
    I am not sure why this count as reason to not embed. I mean, MongoDB allows the user to specify exactly which fields to load. so, if I do not want to load the embedded document from DB to the application, I can just add it to the exclusion list.
    however, I know that this will save network bandwidth between DB server and app server but not sure how much impact it will have on the DB server itself; since the DB server still needs to load the document from the filesystem and then send it to the app server.

  • @nicolascondrea8068
    @nicolascondrea8068 4 года назад +1

    You deserve more subscribers! Flawless video, definitely learned a few gems from this one!

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +1

      Thank you so much Nicolas - I may be biased, but I totally agree ;)

  • @josemurillo4728
    @josemurillo4728 Год назад +1

    Just one! Love that part. Great vid thanks!

  • @rallysahil
    @rallysahil 9 месяцев назад

    Thanks a bunch ! It was quite useful especially to see patterns at last.

  • @ivandrofly
    @ivandrofly 7 месяцев назад +1

    43:09 - Good note
    48:50 - Ref tutorial

  • @extremespartan117
    @extremespartan117 4 года назад +2

    Fantastic and straightforward presentation! Thank you sir!

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      Oh my gosh! Thank you so much!

  • @donaldjunior1442
    @donaldjunior1442 4 года назад +1

    Super thanks. Something not spoken about a lot. Modifying schemas structure in production. How can I drop a schema property that I don't need any more? Say username was unique on the user and we don't need that anymore in production. How can I go about that?

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      Great question! You will have to write an update query to go through all the appropriate documents and update the schema to your new value.

    • @donaldjunior1442
      @donaldjunior1442 4 года назад

      @@JoeKarlsson thanks for the response. Lost a little. To elaborate e.g. Schema({username: {required: true, unique: true}, firstName:...}) and now we don't need the username anymore. Any operations such as create collection documents without username would error.

  • @gurmukhsingh2026
    @gurmukhsingh2026 2 года назад +1

    This is the best into for MongoDB. thanks a lot!

  • @mahendranath2504
    @mahendranath2504 3 года назад

    this is a lot of clear content on how to schema our mongo, I have been checking about this topic for a long, but I have a question , in SQL we have partials if DB is big or sharding , do we have such thing here

  • @sayitlikeitis1202
    @sayitlikeitis1202 3 года назад +1

    Very well explained .. Joe. Super presentation .. Thanks much !!

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      You are so welcome - I am so glad it helped!

  • @ashishchandwani9179
    @ashishchandwani9179 4 года назад +2

    Awesome Video! Thanks, Can you also please make a video on Querying the Data from Documents, especially when we are using referencing.

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +2

      That's a great idea! I can for sure do that!

  • @xKenshin13
    @xKenshin13 3 года назад +1

    Actually quite helpful. Answered most of my questions. Thank you :)

    • @JoeKarlsson
      @JoeKarlsson  3 года назад +1

      That's awesome! So glad it clicked with you!

  • @Cons2911
    @Cons2911 10 месяцев назад

    I’m early into the video but I just want to say thank you. I’m new to this, so I’m trying to understand esp coming from relational

  • @haishuyao4834
    @haishuyao4834 3 года назад +1

    Really helps doing my course project and many thannnnnnks!

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      Oh my gosh! So glad it's useful!

  • @harujei24
    @harujei24 4 года назад +1

    Thank you so much! I finally understand how to design my Schema. I subscribed.

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      YAY! That's the best - thank you so much!

  • @BryanChance
    @BryanChance 3 года назад

    I wonder if many users jump to NoSQL because they don't have to formally "design" a schema. Just insert a record (they call it "row" nowadays) and any missing fields (they call it a column nowadays) are created. Now, you've got records with different fields in the same table. However, MongoDB is a great NoSQL database. I use it for metric and performance data collection and statistics. MongoDB can perform write operations very quickly. The data is automatically expired after use. MongoDB is stable as well. Running 4 years+ 24x7, zero downtime.

  • @ashantharindu8915
    @ashantharindu8915 3 года назад +1

    Mongodb scheme design is well explained. Thank you very much.

  • @scienceblossom6197
    @scienceblossom6197 2 года назад

    I really enjoyed the it Joe! I just want to ask one thing, for one rule you said arrays should not grow without bound, and then in the example, it was just that! The two-way referencing in the task management app example where both users have an array of references of tasks, and tasks have an array of references to the users. So this has no bound... maybe by "without bound" you meant "extremely large"?!
    Thank you so much again!!!

  • @makari1506
    @makari1506 Год назад

    Hi Mr.Joe,
    Great video and I learnt a lot.
    I was wondering whether you’ll be able to clear a doubt I have.
    In my project, users and tasks collections. I would like to save who created a task in a “createdBy” field. It’s always gonna be one value and would be selected every time one or multiple tasks are fetched.
    According to this video, I should embed essential data such as (userId and name) that my application would display. But I want to “refer” the user data so that fields such as name are fetched correctly. I worry if I embed the name and user updates their name, it could become costly to update in all the embeds.
    May I know what your approach would be?
    Thanks

  • @saibabaalapati8446
    @saibabaalapati8446 3 года назад +1

    I'm relieved bro this is best and helpful very much thanks ....

  • @umeshwar21
    @umeshwar21 4 года назад +1

    great , I found it is very help full video to start project with schema design

  • @YoloMonstaaa
    @YoloMonstaaa 3 года назад +2

    You're an amazing teacher. Thank you.

  • @finalfantasy7820
    @finalfantasy7820 4 года назад +1

    I came from your blog post where this video wasn't shown properly. You might want to fix it, cheers.

  • @tgerambio
    @tgerambio Год назад

    This is beautifully explained. Thank you sir!

  • @aniketsao
    @aniketsao 4 года назад +1

    Awesome video. thanks for creating and sharing it. I'm new to the NoSQL databases, is there a way to test the performance of embedding vs referencing ? given the unknowns of how an application would evolve, its hard to stick to one design. have you encountered any scenarios where over time the design needed to be changed from embedded to referencing.

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +1

      The best way to determine which schema is "best" is to run experiments by running queries with different schemas and using the built-in MongoDB Performance Advisor to determine which one is fastest.
      And yes, I have seen people needing to shift schema's overtime all the time. It's really common for web apps to have features and requirements shift over time. So, an old schema that worked great, no longer fits new requirements. It's not a problem to update your schema.

  • @BiharGaurav
    @BiharGaurav 2 года назад

    Instead of referencing can I keep just list of id of another document and just query those specific ids? I mean what will be the performance in that case?

  • @premprakash7981
    @premprakash7981 4 года назад +1

    Awesome Explanation. You have nailed it

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      Thank you so much! Glad you enjoyed it!

  • @Adam-uu8dc
    @Adam-uu8dc 2 года назад +1

    Love the office meme. Great tutorial!

  • @HSBTechYT
    @HSBTechYT 3 года назад

    Discovered you from Twitter. Amazing talk Joe 🙏

  • @harrisfpv
    @harrisfpv 3 года назад +1

    That was great content!!! Answered many questions.

  • @someoneelse5005
    @someoneelse5005 3 года назад

    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

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      LOL - thank you?

    • @someoneelse5005
      @someoneelse5005 3 года назад +1

      @@JoeKarlsson I know my message is confusing because I had such mixed feelings about this video, but everyone on my team loves it :D Apparently my ears are super sensitive to fry frequencies and nobody else minds it.

    • @JoeKarlsson
      @JoeKarlsson  3 года назад +1

      @@someoneelse5005 Your review was hilarious - It's a actually a glowing review. I'm considering printing it out and framing it! I'm so glad y'all enjoyed it. I'll be making more soon!

    • @someoneelse5005
      @someoneelse5005 3 года назад

      @@JoeKarlsson I hope so, your content is killer :D

  • @fernandoventilari839
    @fernandoventilari839 3 года назад +1

    You really saved me. Thanks a lot!!! Subscribed

  • @t_kien
    @t_kien 4 года назад

    I'm newbie and I found this video is amazing, now I can do it.

  • @joaquindelprado133
    @joaquindelprado133 4 года назад +4

    this is a really nice video!! thanks a lot for sharing your knowledge it's help me a lot

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      Yay! Thank you so much! I'm so glad that it's useful :D

  • @jasonbraithwaite9204
    @jasonbraithwaite9204 5 месяцев назад

    Excellent video, very well explained 👍

  • @ranylfoumbi4641
    @ranylfoumbi4641 4 года назад +5

    great!
    courage bro!
    it has solved many of my doubts

  • @polyglotathlete
    @polyglotathlete 4 года назад +1

    one of the best explanations, thanks from Bolivia :D

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      Oh my gosh! So glad it's useful!

  • @arrafiialfa4609
    @arrafiialfa4609 3 года назад +1

    hi I got a question would it be better to keep reference on both document in one to many scenario or would it be better to just keep the reference on the one document that holds many docs ?

  • @ayushkushwaha171
    @ayushkushwaha171 4 года назад +2

    Thanks for the video Joe

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +1

      Oh my gosh! I am so glad you enjoyed it!

  • @gompro
    @gompro 4 года назад +2

    Thank you for bringing up a really cool video!

  • @officialgrasptechnology1804
    @officialgrasptechnology1804 3 года назад +1

    Thanks for the vid, now I need someone opinion. Am build a e-commerce store to sell clothing but am wonder if I should put all the product variants in the same document or reference it since as each product have more than one variants. Max properly be arround 10 variants and I only need the data to display on the home page as in "2 images,price and name". What's your guys opinion on this? And what about the query if I only need 2 images,name and retail price on the landing page.

    • @JoeKarlsson
      @JoeKarlsson  3 года назад +1

      Depends on how you will use it. Are you planning on showing all variants on your product detail page? If yes, it might be a good idea to embed it since you don't have very many sub variants. Does that help/make sense? 🥰🥰🥰

  • @quicksketch1617
    @quicksketch1617 4 года назад +1

    If I want to present the elements from my database like a diagram, exist something like that? If I want to search for data it's not possible if I normalize?

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      There are no visual tools that show normalized diagrams on MongoDB data, however, we do have a tool called MongoDB Compass that makes it really easy to view and navigate your data. www.mongodb.com/products/compass

    • @gmendozamb
      @gmendozamb 4 года назад

      I was looking for it too and found this free online tool:
      mongo.tools

  • @andrew-ni1lb
    @andrew-ni1lb 4 года назад +1

    Dude, thanks, I have enjoyed your explanations!

  • @arunkutz
    @arunkutz 3 года назад +1

    Very Informative . Thank you for this video.

  • @Alikus78
    @Alikus78 4 года назад +1

    Thank you very much for the presentation! So if data I am embedding instead of referencing needs to have its own unique ID. I am used to getting these IDs for free in SQL world... is there something Mongo DB had for this or I am on my own with generating and keeping track of these IDs? Thanks!!

    • @JoeKarlsson
      @JoeKarlsson  4 года назад +1

      By default, MongoDB creates a unique UUID under the _id key on every single document you create. You get them for free with MongoDB too! :)

    • @alikkasman9853
      @alikkasman9853 4 года назад +1

      @@JoeKarlsson I was taking about adding an ID to a subitem inside document (embedded structure) that doesn't get an ID by default. Looks like I can generate this ID in application by doing something like BSON::ObjectId.new and it will be unique to the DB

    • @JoeKarlsson
      @JoeKarlsson  4 года назад

      @@alikkasman9853 Yes! You are exactly right :)

  • @davidtorres5012
    @davidtorres5012 3 года назад +1

    Awesome! Great explanation

  • @pedropalma3748
    @pedropalma3748 3 года назад

    Great presentation, loved it. Keep them coming😊

  • @ubermansch4871
    @ubermansch4871 4 года назад +1

    you deserve 1 million subscribers

  • @aminatawillane5633
    @aminatawillane5633 2 года назад

    Hey there, best video ever on mongoDB schema design I ever seen that far...Thx for it...
    Since I am building a 5G SA tele medecine project based on mongoDB Atlas and Flutter, may I know please if u' re about to make a class for it? N thx again for that brilliant video...

  • @dwhlab5436
    @dwhlab5436 9 месяцев назад

    Such a amazing video .. many thanks .. great work.. cheers :)

  • @soyebganja8632
    @soyebganja8632 4 года назад +3

    Many thanks:)

  • @juancruzstingo
    @juancruzstingo 3 года назад

    Joe, I have a small question, how should I handle updates in the twitter example if one of the followers changes his name? Thanks and the video was really helpful!

  • @blackarrow9100
    @blackarrow9100 3 года назад +1

    Can WE have 2 schema in the same collection ? Like two type of user user1 and user2 in collection users ???

    • @JoeKarlsson
      @JoeKarlsson  3 года назад

      Absolutely! Google "Polymorphic Pattern" for more information

  • @omadoyeabraham219
    @omadoyeabraham219 Год назад

    Absolutely amazing explanation 👌

  • @brianculp3113
    @brianculp3113 3 года назад

    Experienced SQL user, designing my first noSQL schema for work.
    Would you use embedding or referencing if the only concern not to is the document size limit?
    It would be including large amounts of integers and calculations based on location data (so some documents would be smaller, some very large), but everything is needed everytime, so joins would hamper speed.

    • @samuelnzekwe7696
      @samuelnzekwe7696 2 года назад

      For this, I would go with embedding for sure. Since every query to the database needs to return every data all the time.