Data grouping shapes a CQRS view’s records to match query results. Embed related entities for one-read retrieval, or keep them separate and gather them at query time. Balance query efficiency against event-handler update efficiency. section 13.3.2
Choose grouping by weighing query needs against database capabilities:
- Embed related entities when queries return them together; an order record can include its ticket and delivery. section 13.3.2
- Document and key-value stores can nest collections; relational rows can fold in a related entity only when there is at most one. section 13.3.2
Figure 13.6 There are often multiple ways to group records, each with different tradeoffs. A customer’s orders can be stored in a customer document, or each order can be stored in its own document.
Compare storing a customer’s orders in one document with storing each order separately. section 13.3.2






