In this approach, the developer defines a set of small classes (that is, building blocks) that represent objects needed in your application that must ultimately be stored. You then define a collection of document structures as a super-set of these small classes. We have already seen an example of this approach in the design for Book Someplace. For example, we designed an object location, which includes fields such as streetAddress, city, postalCode, and more. This class was then used as part of the document structure for both the customers and the properties collections.
The advantage of this approach is that the size of each document is smaller and more manageable. The disadvantage is that you might need to perform a secondary lookup if additional information from the other collection is needed.
As an example, recalling the Book Someplace scenario, when we create an entry in the bookings collection, we include the following small objects containing...