MongoDB architecture: how to store a large amount of arrays or sub documents in a scalable way
问题 I am currently working on a blogging app, in which users can create their own blogs and each blog has blogposts within that. I'm ideating about architecting a database that is scalable when each blog has a lot of blogposts. So is it better to structure my database as this: blog1 : { blogname : 'blog1', blogposts: [array of blogposts] }, blog2 : { blogname : 'blog2', blogposts: [array of blogposts] } Or should I create a separate collection with all the blogposts, something like this: