Q:

DB design for mongodb regarding embedded content?

i have a question regarding embedded relations in mongoDB.
e.g. if i have a data strcutre like this:
company
- company_members
- company_clients
- company_templates
-- company_templates_items

should i use embeds here, so members, clients and templates are embedded in the company collection and the templates_items are embedded in the company_templates, OR should i use referenced relations here?
i'm asking this, because I'm wondering if the db query-response is too big when everything is embedded?
any advice?
thanks!
edit:
the content of the table would be e.g. 100 companies, each has 15 clients, 20 members and 4 templaes with 10 items each.
everything is text. 

A:

Even with the additional information from your edit, it's hard to judge. We need to know what you want to accomplish. I'll show you two options to explain what I mean, and I think you can deduce what is right for you from it.
Ex. A: You're building a type of yellow pages web site
Let's say you want to build a webpage that lists companies and some of their clients, along with samples of their work. The data will mostly be read. The only one who can change the information is the customer (an employee of the respective company), who can log in and change some data. Changes don't occur very often, and there are no versioning conflicts.
In that case, embedding is fine. Since you probably want to display that information together, the amount of information is not a killer, and there is only one writer.
Ex. B: You're building a SaaS project management solution
Employees of the company can log in and manage clients, add or remove users, and create/read/update/delete (CRUD) project templates. Many people can be logged in at the same time.
In that case, none of the above, except perhaps company_templates_items should be embedded.

As a guideline, consider this: If collection items can undergo CRUD operations by different users, and different objects could be edited at the same time without a problem (in the business sense), don't embed. For instance, there's nothing wrong with Jim adding a new customer while Jane edits one and Mike creates a new project. If all these operations have to write to the same object, your will have to be very, very careful in your code to make sure nothing is lost, overwritten or added twice.
You could use $push, $pull, etc. to make those operations atomic, but sorting, searching and updating are more complicated. Generally, a collection has many more features than an embedded document.

