MongoDB: embedding performance question
I ju开发者_如何学编程st started learning MongoDB, and I really like the idea of embedding collections instead of referencing them.
MongoDB's documentation recommends to use embedding if performance is needed.
I just thought about a simple forum model. Let's say, every board category has several boards, every board has several topics, and every topic has several messages. All of these collections are embedded.
After some time the size of the board category will be huge. Way more than the 2MB limit. Does this mean that there's a flaw in this design?
Yes it's a bad design. Using a Embedded document to something grow every time is a bad design. The limit of document is do by mongoDB mainteneur to avoid this document increase.
精彩评论