it's very use case specific as to what is best, but typically for a system like this, the products aren't embedded in the vendor objects.
typically i would have a vendors collection and a products collection, and each product document has a vendor_id field. typically there is a category field in each product document.
with that sort of setup you could query all products in a category, or all products for a vendor, or both, easily. you could not easily query something that spans the vendor and product collections. also your scope of atomicity is the document level, so as i have laid out here that is a fairly small scope.
so that suggests this is a "linking" not an embedding case, as normally done. so what are some examples where one would embed to contrast? here are a couple:
- shopping cart document would contain an array of cart line items.
- similarly, an order docoument for a customer would contain an array of line items purchased in that order.
- the product documents discussed above might include an embedded list of changes over time (such as price changes), in a field revision_history which is an array of documents that look something like { time : ..., who_changed : ..., what_changed : ... }
- if a customer has mutliple shipping addresses i'd store them in an array of subdocuments in the customer document