database - How to design product category and products models in mongodb? -
i new mongo db database design, designing restaurant products system, , design similar simple ecommerce database design each productcategory has products in relational database system 1 (productcategory) many products. have done research understand in document databses. denationalization acceptable , results in faster database reads. therefore in nosql document based database design models way //product { name:'xxxx', price:xxxxx, productcategory: { productcategoryname:'xxxxx' } } my question this, instead of embedding category inside of each product, why dont embed products inside productcategory, can have products once query category, resulting in model. //productcategory { name:'categoryname', //array or products products:[ { name:'xxxx', price:xxxxx }, { ...