40장. Aggregate Boundary로 문서 크기를 통제한다
함께 읽고 원자적으로 바뀌는 작은 값은 embed 후보지만 무한히 늘어나는 event·comment·photo를 한 document array에 쌓지 않는다. BSON 16MB 한계에 닿기 전에도 큰 document rewrite, network, cache와 contention 비용이 생긴다. 참조로 나누면 join·transaction과 consistency owner를 설계해야 한다.
OrderPulse는 현재 주문 요약과 제한된 line을 주문에 embed하고 상태 event·large attachment를 별 collection으로 둔다. schema review에는 최대 cardinality, 성장률, update frequency, read shape, delete/retention과 migration을 적는다. average fixture만 만들지 않고 최대 line·긴 문자열·hot customer를 seed한다.