For an order, one rule decides it: embed what you read together, reference what must stay current, and copy values that belong to the moment of purchase, like the price paid. In our test, one order stored as a document read in 1 query, while renaming one popular product rewrote 1,178 order documents and changed 1 row in normalized tables.
What embed and reference mean
Embedding stores related data inside its parent record. An order document holds the customer, the shipping address and every line item, with each product name copied in. Referencing stores an ID that points to a record kept elsewhere, so the order line holds a product ID and the name lives once, in the products table. MongoDB's own modeling guide says the same: embed data that is queried together, reference data that grows without bounds.
Reading one order
We built the same shop twice from a fixed seed: 10,000 orders, 500 products and 2,000 customers, in two in-memory SQLite databases, one captured run on an Apple M2 Pro with Node v22.13.1.…